@@ -1209,6 +1209,13 @@ async fn call_service(
12091209 } ;
12101210
12111211 if let Some ( resource_path) = path. strip_prefix ( "/~/ui" ) {
1212+ if resource_path == "" {
1213+ let redirect_path = "/~/ui/" . to_string ( ) ;
1214+ return Ok ( Response :: builder ( )
1215+ . status ( hyper:: StatusCode :: FOUND )
1216+ . header ( hyper:: header:: LOCATION , redirect_path)
1217+ . body ( empty ( ) ) ?) ;
1218+ }
12121219 return handle_ui_request ( req, resource_path) . await ;
12131220 }
12141221
@@ -1257,7 +1264,7 @@ async fn call_service(
12571264 let redirect_path = "/~/ui/" . to_string ( ) ;
12581265 return Ok ( Response :: builder ( )
12591266 . status ( hyper:: StatusCode :: FOUND )
1260- . header ( "Location" , redirect_path)
1267+ . header ( hyper :: header :: LOCATION , redirect_path)
12611268 . body ( empty ( ) ) ?) ;
12621269 } else {
12631270 return Ok ( Response :: builder ( )
@@ -1311,7 +1318,10 @@ async fn call_service(
13111318 if parsed_url. pathinfo . starts_with ( "/info/lfs" ) {
13121319 return Ok ( Response :: builder ( )
13131320 . status ( hyper:: StatusCode :: TEMPORARY_REDIRECT )
1314- . header ( "Location" , format ! ( "{}{}" , remote_url, parsed_url. pathinfo) )
1321+ . header (
1322+ hyper:: header:: LOCATION ,
1323+ format ! ( "{}{}" , remote_url, parsed_url. pathinfo) ,
1324+ )
13151325 . body ( empty ( ) ) ?) ;
13161326 }
13171327
@@ -1493,7 +1503,7 @@ async fn serve_query(
14931503 Ok ( Some ( ( res, params) ) ) => Response :: builder ( )
14941504 . status ( hyper:: StatusCode :: OK )
14951505 . header (
1496- "content-type" ,
1506+ hyper :: header :: CONTENT_TYPE ,
14971507 params
14981508 . get ( "content-type" )
14991509 . unwrap_or ( & "text/plain" . to_string ( ) ) ,
0 commit comments