Ticket #61 (enhancement)
Opened 1 year ago
Last modified 10 months ago
Patch for construct_url to handle HTTPS
Status: reopened
| Reported by: | wyatt.lee.baldwin@gmail.com | Assigned to: | somebody |
|---|---|---|---|
| Priority: | major | Milestone: | |
| Component: | component1 | Version: | |
| Keywords: | Cc: | 11110000b@gmail.com | |
I've been having trouble getting AuthKit? to generate FORM_ACTION URLs behind a proxy. 1) It was generating URLs for the app server instead of for the proxy server. 2) It also wasn't detecting SSL and prepending https://.
The following patch fixes both of those issues, though I would like to note that this is my first time poking into the AK source in any depth. Also, I didn't try to clean anything up. I just worked with the existing logic and added the minimum amount of code to get things working for my use case.
Attachments
Change History
09/10/08 20:04:18: Modified by wyatt.lee.baldwin@gmail.com
- attachment authkit-construct_url-handle-ssl.diff added.
11/09/08 20:44:41: Modified by thejimmyg
- status changed from new to closed.
- resolution set to fixed.
I haven't applied this patch exactly but I've incorporated the ideas into a more general overhaul. There is also now an authkit.form.action option which you can use to override AuthKit's guess manually if it isn't correct.
Let me know how you get on with it. It is in trunk now and will appear in 0.4.3.
Thanks,
James
11/24/08 16:43:26: Modified by anonymous
- status changed from closed to reopened.
- resolution deleted.
11/24/08 17:02:21: Modified by 11110000b@gmail.com
- cc set to 11110000b@gmail.com.
Current version of http://authkit.org/trac/browser/AuthKit/trunk/authkit/authenticate/form.py?rev=169 doesn't work for me. I'm using WSGI app behind Apache via HTTPS and construct_url creates http url. Problem is with if port == '443' which fails at line 164, replacing it with str(port) == '443' works for me.
There's another problem I spotted after reading this code - what if it's HTTPS connection but on different port? I think code won't work.

Patch to generate correct URLs behind proxy (for both http and https)