This repository was archived by the owner on Dec 7, 2018. It is now read-only.
File tree 1 file changed +6
-10
lines changed
1 file changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -165,19 +165,15 @@ def handler(req):
165
165
# Resolve symlink
166
166
while requested_object .type == 'blob' and requested_object .mode == requested_object .link_mode :
167
167
try :
168
- link_requested_path = normpath ('/' .join (requested_path [:- 1 ]) + '/' + \
169
- requested_object .data_stream .read ().decode ('utf-8' ))
170
- requested_path = link_requested_path .strip ('/' ).split ('/' )
171
- requested_path = list (filter (None , requested_path ))
168
+ link_target = requested_object .data_stream .read ().decode ('utf-8' )
172
169
173
- redirect_target = '/' .join (requested_path )
174
170
# TODO: Moved protocol values for verfication
175
171
# to program parameters
176
- if not redirect_target [0 :7 ] == 'http://' and \
177
- not redirect_target [0 :8 ] == 'https://' :
178
- redirect_target = '/' + redirect_target
179
-
180
- req .headers_out .add ('Location' , redirect_target )
172
+ if link_target [0 :7 ] == 'http://' or \
173
+ link_target [0 :8 ] == 'https://' :
174
+ req . headers_out . add ( 'Location' , link_target )
175
+ else :
176
+ req .headers_out .add ('Location' , '/' + link_target )
181
177
return (getattr (apache , config ['gitblog.redirect_code' ]))
182
178
except :
183
179
return (apache .HTTP_NOT_FOUND )
You can’t perform that action at this time.
0 commit comments