Edgewall Software

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#11793 closed defect (fixed)

FCGI gateway does not adequately detect URL scheme

Reported by: ccm Owned by: chaz
Priority: normal Milestone: 1.0.5
Component: web frontend Version: 1.0.1
Severity: normal Keywords: fcgi patch proxy
Cc: Branch:
Release Notes:


API Changes:
Internal Changes:


Unlike the WSGI gateway, the FCGI gateway's HTTPS detection is inadequate. Here's a patch the fixes the issue by copying the relevant code from trac/web/wsgi.py to trac/web/_fcgi.py.

Attachments (1)

0001-Try-harder-to-detect-the-correct-URL-scheme.patch (571 bytes ) - added by chaz 8 years ago.

Download all attachments as: .zip

Change History (8)

comment:1 by chaz, 8 years ago

As an example, the FCGI gateway currently will set wsgi.url_scheme to https if HTTPS in the environment is on but not if it is ON (all caps).

comment:2 by Peter Suter, 8 years ago

Milestone: 1.0.4

This looks reasonable. For reference the existing wsgi.py code got the HTTP_X_FORWARDED_PROTO check in #8131 for WSGI. (Other than that both the initial FCGI ([2130]) and WSGI ([2957]) HTTPS detection remain unchanged.)

comment:3 by Ryan J Ollos, 8 years ago


comment:4 by Peter Suter, 8 years ago

Keywords: proxy added

X-Forwarded-Proto was also discussed in #6013.

#11718 (about X-Real-IP and X-Forwarded-For) was just closed as wontfix. Are there any similar problems here? I assume since this is fine for WSGI it's also fine for FCGI.

comment:5 by Jun Omae, 8 years ago

Yeah. I think no problems here. It would be good to handle HTTP_X_FORWARDED_PROTO in _fcgi.py.

comment:6 by Peter Suter, 8 years ago

Release Notes: modified (diff)
Resolution: fixed
Status: newclosed

Thanks for confirming!

Committed in [13783] and merged to trunk in [13784].

comment:7 by Peter Suter, 8 years ago

Owner: set to chaz

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain chaz.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from chaz to the specified user.

Add Comment

E-mail address and name can be saved in the Preferences .
Note: See TracTickets for help on using tickets.