Fix FormData
This commit is contained in:
		
							parent
							
								
									62d9ca8b64
								
							
						
					
					
						commit
						e6d8e70bb1
					
				
							
								
								
									
										8
									
								
								app.js
									
									
									
									
									
								
							
							
						
						
									
										8
									
								
								app.js
									
									
									
									
									
								
							@ -18,10 +18,16 @@ const service = "[Unit]\n" +
 | 
			
		||||
    "WantedBy=multi-user.target";
 | 
			
		||||
 | 
			
		||||
function generateQuickCmd() {
 | 
			
		||||
    let reqData = new FormData();
 | 
			
		||||
    reqData.append("format", "json");
 | 
			
		||||
    reqData.append("content", encodeURI(buildCmd()));
 | 
			
		||||
    reqData.append("expires", "3600");
 | 
			
		||||
    reqData.append("lexer", "bash");
 | 
			
		||||
 | 
			
		||||
    fetch("https://paste.nevets.tech/api/", {
 | 
			
		||||
        method: "POST",
 | 
			
		||||
        headers: {'Content-Type': 'application/json'},
 | 
			
		||||
        body: "{\"format\":\"url\",\"content\":\"" + encodeURIComponent(buildCmd()) + "\",\"expires\":3600,\"lexer\":\"bash\"}",
 | 
			
		||||
        body: reqData,
 | 
			
		||||
        mode: "cors"
 | 
			
		||||
    }).then(res => res.json().then(json => {
 | 
			
		||||
        document.getElementById("script").innerText = "curl -s " + json.url + "/raw | bash";
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user