Closed Fingercomp closed 6 years ago
Can't you get that from the response headers?
local _,_,headers = request.response()
doSomethingWith(headers['Location'])
Or something like that?
OpenComputers automatically redirects requests if a server tells so. There is no "Location" header. And none of those headers contain URL.
Uhh, that's Java's doing then though, dunno if that can be disabled?
Looks like you can: http://stackoverflow.com/a/2659022
Cool. Then the only remaining question is: new parameter or make that the default? Probably the former for less breakage, I guess.
I'd actually prefer we not try to handle redirects ourselves. I suppose if someone PRs this and the work looks reliable I'd consider it. But I'd prefer we leave it alone
@payonel, it sounds like you misread this one, this is kinda about letting OC not do the redirect. :P
@skyem123 i understand, but I didn't explain myself well. If java doesn't do the redirect, then OC will have to, or openos will, or user code will. Someone will, and I'd prefer to leave that to our java libraries we are using.
True, but why not make it an optional thing? Allows a level between "raw TCP" and "HTTP doing everything automagicaly". :p
That would be useful if request gets redirected so I could easily get an URL it was redirected to. Ex.: