-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for disabling redirects #28
Conversation
I don't mind putting this in (there are worse things to feature creep on), but I'm unsure if just writing something custom using gmcurl might be a better fit. Granted, I'll most likely have to add some functionality to that instead then, but I'm very happy to do that.
The reason why we aren't using
You put |
I prefer the simplicity of a mostly-drop-in replacement to be honest.
Oh, lol. Fixed it...after some wrangling with the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! The full URL mixup is probably not an actual issue, or at least not one that we are at fault for. It's more likely that flask is trying to be too smart for its own good.
Released in version 1.9.0. |
I have a use case where what I need the HTTP call to do is "expand" the URL. Basically do the opposite of what a link-shortening service does, where we want the
Location
header. Normally in cURL, this would be controlled byCURLOPT_FOLLOWLOCATION
, but I didn't want to fiddle with your existing implementation too much.What I've added is a per-HTTPRequest boolean called
noredirect
. It'sfalse
by default (follow redirects).Also for some reason I can't get the new tests to work, but the changes do work on a real GMod server, at least with linux64. I'm probably just missing something. If I figure that out, I'll update the PR.