ScriptCraft
ScriptCraft copied to clipboard
http module returns 403 error without user agent
Hello! Today I was having some trouble figuring out why my HTTP request wasn't working, every time that I tried to request something, it would return a 403 error, after doing some testing, I found that you need to set a User-Agent to prevent this issue, to do that, just add the following line to the quest.js file at scriptcraft/modules/http:
conn.setRequestProperty("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.29 Safari/537.36");
at line 112, after the
conn.requestMethod = requestMethod;
after that, it should work just fine!