@@ -426,22 +426,19 @@ fn response(
426
426
cookies : CookieJar ,
427
427
extension : Option < String > ,
428
428
config : & Data < Config > ,
429
- redir : bool ,
430
429
) -> impl Responder {
431
430
let name = name. clone ( ) + & extension. map ( |e| format ! ( ".{e}" ) ) . unwrap_or_default ( ) ;
432
- let mut res = HttpResponse :: Ok ( ) ;
433
- if redir {
434
- res = HttpResponse :: Found ( ) ;
435
- res. append_header ( ( header:: LOCATION , name. clone ( ) ) ) ;
436
- }
437
- res. cookie_delta ( & cookies) . body ( format ! (
438
- "{}{name}" ,
439
- if !config. base_url. is_empty( ) && !config. base_url. ends_with( '/' ) {
440
- format!( "{}{}" , config. base_url, "/" )
441
- } else {
442
- format!( "{}" , config. base_url)
443
- }
444
- ) )
431
+ HttpResponse :: Found ( )
432
+ . append_header ( ( header:: LOCATION , name. clone ( ) ) )
433
+ . cookie_delta ( & cookies)
434
+ . body ( format ! (
435
+ "{}{name}" ,
436
+ if !config. base_url. is_empty( ) && !config. base_url. ends_with( '/' ) {
437
+ format!( "{}{}" , config. base_url, "/" )
438
+ } else {
439
+ format!( "{}" , config. base_url)
440
+ }
441
+ ) )
445
442
}
446
443
447
444
#[ post( "/" ) ]
@@ -453,7 +450,7 @@ async fn post_raw(
453
450
) -> Result < impl Responder > {
454
451
create_file ( payload, & database, & mut cookies, & config)
455
452
. await
456
- . map ( |it| response ( it, cookies, None , & config, false ) )
453
+ . map ( |it| response ( it, cookies, None , & config) )
457
454
}
458
455
459
456
fn is_form ( it : & GuardContext ) -> bool {
@@ -516,6 +513,5 @@ async fn post_form(
516
513
cookies,
517
514
extension,
518
515
& config,
519
- true ,
520
516
) )
521
517
}
0 commit comments