#1159 closed defect (fixed)
Hard coded scheme in ticket notify emails (https vs. http)
| Reported by: | Owned by: | Christopher Lenz | |
|---|---|---|---|
| Priority: | normal | Milestone: | 0.8.1 |
| Component: | general | Version: | 0.8 |
| Severity: | normal | Keywords: | |
| Cc: | Branch: | ||
| Release Notes: | |||
| API Changes: | |||
| Internal Changes: | |||
Description
My trac installation is located at https://hostname:port/trac.cgi
Now when trac sends ticket change email notifications, it drops the https:// and replaces it with http://.
Attachments (0)
Change History (8)
comment:1 by , 21 years ago
comment:2 by , 21 years ago
| Milestone: | → 0.8.1 |
|---|---|
| Owner: | changed from to |
comment:3 by , 21 years ago
| Status: | new → assigned |
|---|
comment:4 by , 21 years ago
| Resolution: | → fixed |
|---|---|
| Status: | assigned → closed |
comment:5 by , 21 years ago
| Resolution: | fixed |
|---|---|
| Status: | closed → reopened |
In fact there is similar code section in ModPythonHanlder.py So this change should be also ported for it. Sorry that I missed it with my first patch.
comment:6 by , 21 years ago
I added similar code to the mod_python handler in [1276] (trunk). Can you verify whether it works? I have no SSL setup here for testing.
comment:7 by , 21 years ago
| Resolution: | → fixed |
|---|---|
| Status: | reopened → closed |
Just reopen when [1276] doesn't fix this issue.
comment:8 by , 21 years ago
Hello, with trac @ r1280 + mod_python + Brad's PgSQL patch, Tickets emails work ok with Trac over https on non-standard port. Thanks!



The attached patch fixes it here. Cmlenz had following comments about this patch
13:29 < cmlenz_> btw, I've seen "if os.getenv('HTTPS') in ('on', '1')" used somewhere else... not sure why it should be "1" instead of "on",. but anyway,This environment variable is documented here: Apache mod_ssl. Apache doc says that type is flag, so perhaps in ('on', 1) is a good idea (so far I have only seen 'on').
Index: trac/core.py =================================================================== --- trac/core.py (revision 1211) +++ trac/core.py (working copy) @@ -359,8 +359,13 @@ host = os.getenv('SERVER_NAME') proto_port = '' port = int(os.environ.get('SERVER_PORT', 80)) - if port == 443: - proto = 'https' + # when you support Apache's way, you get it 60% right + if os.getenv('HTTPS') == 'on': + proto = 'https' + if port != 443: + proto_port = ':%d' % port + elif port == 443: + proto = 'https' else: proto = 'http' if port != 80: