http module returns 403 error without user agent · Issue #435 · walterhiggins/ScriptCraft · GitHub
Skip to content

http module returns 403 error without user agent #435

Open

Description

@ithan

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!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions