Show More
@@ -23,6 +23,7 b'' | |||||
23 | # You should have received a copy of the GNU General Public License |
|
23 | # You should have received a copy of the GNU General Public License | |
24 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
24 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | |
25 |
|
25 | |||
|
26 | from pylons.controllers.util import Request | |||
26 | from rhodecode.lib.utils2 import str2bool |
|
27 | from rhodecode.lib.utils2 import str2bool | |
27 |
|
28 | |||
28 |
|
29 | |||
@@ -34,7 +35,11 b' class HttpsFixup(object):' | |||||
34 |
|
35 | |||
35 | def __call__(self, environ, start_response): |
|
36 | def __call__(self, environ, start_response): | |
36 | self.__fixup(environ) |
|
37 | self.__fixup(environ) | |
37 | return self.application(environ, start_response) |
|
38 | req = Request(environ) | |
|
39 | resp = req.get_response(self.application) | |||
|
40 | if environ['wsgi.url_scheme'] == 'https': | |||
|
41 | resp.headers['Strict-Transport-Security'] = 'max-age=8640000; includeSubDomains' | |||
|
42 | return resp(environ, start_response) | |||
38 |
|
43 | |||
39 | def __fixup(self, environ): |
|
44 | def __fixup(self, environ): | |
40 | """ |
|
45 | """ |
General Comments 0
You need to be logged in to leave comments.
Login now