Edgewall Software

Opened 10 years ago

Closed 9 years ago

Last modified 9 years ago

#11793 closed defect (fixed)

FCGI gateway does not adequately detect URL scheme — at Version 6

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

Handle HTTP_X_FORWARDED_PROTO for FCGI.

API Changes:
Internal Changes:

Description

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.

Change History (7)

comment:1 by chaz, 10 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, 9 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, 9 years ago

Milestone: 1.0.41.0.5

comment:4 by Peter Suter, 9 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, 9 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, 9 years ago

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

Thanks for confirming!

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

Note: See TracTickets for help on using tickets.