Mercurial > kallithea
comparison rhodecode/lib/middleware/https_fixup.py @ 1203:6832ef664673 beta
source code cleanup: remove trailing white space, normalize file endings
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Sun, 03 Apr 2011 18:23:15 +0200 |
parents | 110a00c181de |
children | a671db5bdd58 |
comparison
equal
deleted
inserted
replaced
1202:eef9e273347a | 1203:6832ef664673 |
---|---|
2 """ | 2 """ |
3 rhodecode.lib.middleware.https_fixup | 3 rhodecode.lib.middleware.https_fixup |
4 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 4 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
5 | 5 |
6 middleware to handle https correctly | 6 middleware to handle https correctly |
7 | 7 |
8 :created_on: May 23, 2010 | 8 :created_on: May 23, 2010 |
9 :author: marcink | 9 :author: marcink |
10 :copyright: (C) 2009-2011 Marcin Kuzminski <marcin@python-works.com> | 10 :copyright: (C) 2009-2011 Marcin Kuzminski <marcin@python-works.com> |
11 :license: GPLv3, see COPYING for more details. | 11 :license: GPLv3, see COPYING for more details. |
12 """ | 12 """ |
13 # This program is free software; you can redistribute it and/or | 13 # This program is free software; you can redistribute it and/or |
14 # modify it under the terms of the GNU General Public License | 14 # modify it under the terms of the GNU General Public License |
15 # as published by the Free Software Foundation; version 2 | 15 # as published by the Free Software Foundation; version 2 |
16 # of the License or (at your opinion) any later version of the license. | 16 # of the License or (at your opinion) any later version of the license. |
17 # | 17 # |
18 # This program is distributed in the hope that it will be useful, | 18 # This program is distributed in the hope that it will be useful, |
19 # but WITHOUT ANY WARRANTY; without even the implied warranty of | 19 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
20 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 20 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
21 # GNU General Public License for more details. | 21 # GNU General Public License for more details. |
22 # | 22 # |
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, write to the Free Software | 24 # along with this program; if not, write to the Free Software |
25 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, | 25 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
26 # MA 02110-1301, USA. | 26 # MA 02110-1301, USA. |
27 | 27 |
37 return self.application(environ, start_response) | 37 return self.application(environ, start_response) |
38 | 38 |
39 | 39 |
40 def __fixup(self, environ): | 40 def __fixup(self, environ): |
41 """Function to fixup the environ as needed. In order to use this | 41 """Function to fixup the environ as needed. In order to use this |
42 middleware you should set this header inside your | 42 middleware you should set this header inside your |
43 proxy ie. nginx, apache etc. | 43 proxy ie. nginx, apache etc. |
44 """ | 44 """ |
45 proto = environ.get('HTTP_X_URL_SCHEME') | 45 proto = environ.get('HTTP_X_URL_SCHEME') |
46 | 46 |
47 if str2bool(self.config.get('force_https')): | 47 if str2bool(self.config.get('force_https')): |