File tree Expand file tree Collapse file tree 3 files changed +11
-16
lines changed Expand file tree Collapse file tree 3 files changed +11
-16
lines changed Original file line number Diff line number Diff line change @@ -1253,19 +1253,17 @@ async fn call_service(
12531253 }
12541254 pu
12551255 } else {
1256- let redirect_path = if path == "/" {
1257- "/~/ui/" . to_string ( )
1256+ if path == "/" {
1257+ let redirect_path = "/~/ui/" . to_string ( ) ;
1258+ return Ok ( Response :: builder ( )
1259+ . status ( hyper:: StatusCode :: FOUND )
1260+ . header ( "Location" , redirect_path)
1261+ . body ( empty ( ) ) ?) ;
12581262 } else {
1259- format ! (
1260- "/~/ui/browse?repo={}.git&path=&filter=%3A%2F&rev=HEAD" ,
1261- path
1262- )
1263+ return Ok ( Response :: builder ( )
1264+ . status ( hyper:: StatusCode :: NOT_FOUND )
1265+ . body ( empty ( ) ) ?) ;
12631266 } ;
1264-
1265- return Ok ( Response :: builder ( )
1266- . status ( hyper:: StatusCode :: FOUND )
1267- . header ( "Location" , redirect_path)
1268- . body ( empty ( ) ) ?) ;
12691267 }
12701268 } ;
12711269
Original file line number Diff line number Diff line change 2424 $ cd $ {TESTTMP}
2525
2626 $ git clone -q http: // localhost: 8002 / xxx full_repo
27- fatal : unable to update url base from redirection:
28- asked for : http: // localhost: 8002 / xxx/ info/ refs? service= git-upload-pack
29- redirect: http: // localhost: 8002 /~/ ui/ browse? repo= /xxx /info/ refs. git& path = & filter = % 3A% 2F& rev = HEAD
27+ fatal : repository ' http://localhost:8002/xxx/' not found
3028 [128 ]
3129
3230 $ bash $ {TESTDIR}/ destroy_test_env. sh
Original file line number Diff line number Diff line change 2424 date: * (glob)
2525 \r (esc)
2626 $ curl -s -I http: // 127.0 . 0. 1: 8002 / a/ repo
27- HTTP/ 1.1 302 Found\r (esc)
28- location: /~/ ui/ browse? repo= /a /repo. git& path = & filter = % 3A% 2F& rev = HEAD\r (esc)
27+ HTTP/ 1.1 404 Not Found\r (esc)
2928 date: * (glob)
3029 \r (esc)
You can’t perform that action at this time.
0 commit comments