-
Notifications
You must be signed in to change notification settings - Fork 886
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
request.host_port is a str not an int #2512
Conversation
Note, this essentially means the new automatic CSRF checking is broken on any site that uses standard ports right now. |
Wow.. |
Yea, I don't know :( |
Rather than having the list be strings could you cast if int(request.host_port) not in {80, 443}: |
I could do that. The reason I didn't was that I wasn't sure if it'd ever be possible for it to be something that isn't a valid int (empty string?). Sent from my iPhone
|
Wondering if this is something to be fixed in WebOb... |
I doubt you can just switch the type without causing people unnecessary pain. It'd be nice to know if there's a reason it's a string though. |
It's pulled from http://docs.webob.org/en/stable/api/request.html#webob.request.BaseRequest.host_port I don't know if there is a reason for it being string over not. |
On topic, I'm planning to merge this PR. Just bundling it together with a larger change that hopefully I can make later tonight. |
This fixes a logic error in #2501 where I accidentally treated
request.host_port
as anint
when in reality it is astr
. This wasn't exposed in my own testing because I was only using non-standard ports so I expected this to evaluate toFalse
anyways.