Changeset 2052

Show
Ignore:
Timestamp:
01/18/2008 09:07:54 AM (7 months ago)
Author:
glen
Message:

- HTTPS env var should be "on" when using mod_extforward and the X-Forwarded-Proto header is set. (#1499)

Location:
branches/lighttpd-1.4.x
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • branches/lighttpd-1.4.x/NEWS

    r2049 r2052  
    1818  * add IdleServers and Scoreboard directives in ?auto mode for mod_status (#1507) 
    1919  * open log immediately after daemonizing, fixes SIGPIPEs on startup  (#165) 
     20  * HTTPS env var should be "on" when using mod_extforward and the X-Forwarded-Proto header is set. (#1499) 
    2021 
    2122- 1.4.18 - 2007-09-09 
  • branches/lighttpd-1.4.x/src/base.h

    r1942 r2052  
    516516        SSL_CTX *ssl_ctx; 
    517517#endif 
     518       unsigned short is_proxy_ssl; 
    518519} server_socket; 
    519520 
  • branches/lighttpd-1.4.x/src/mod_extforward.c

    r1943 r2052  
    380380        if (real_remote_addr != NULL) { /* parsed */ 
    381381                sock_addr sock; 
    382  
    383382                struct addrinfo *addrs_left; 
     383                server_socket *srv_sock = con->srv_socket; 
     384                data_string *forwarded_proto = (data_string *) array_get_element(con->request.headers,"X-Forwarded-Proto"); 
     385 
     386                if (forwarded_proto && !strcmp(forwarded_proto->value->ptr, "https")) 
     387                        srv_sock->is_proxy_ssl = 1; 
     388                else 
     389                        srv_sock->is_proxy_ssl = 0; 
    384390 
    385391                if (con->conf.log_request_handling) { 
  • branches/lighttpd-1.4.x/src/mod_fastcgi.c

    r2037 r2052  
    20582058        FCGI_ENV_ADD_CHECK(fcgi_env_add(p->fcgi_env, CONST_STR_LEN("SERVER_PROTOCOL"), s, strlen(s)),con) 
    20592059 
    2060 #ifdef USE_OPENSSL 
    2061         if (srv_sock->is_ssl) { 
     2060    if (srv_sock->is_ssl || srv_sock->is_proxy_ssl) { 
    20622061                FCGI_ENV_ADD_CHECK(fcgi_env_add(p->fcgi_env, CONST_STR_LEN("HTTPS"), CONST_STR_LEN("on")),con) 
    20632062        } 
    2064 #endif 
    2065  
    20662063 
    20672064        FCGI_ENV_ADD_CHECK(fcgi_env_add_request_headers(srv, con, p), con);