File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -313,7 +313,7 @@ pub fn create_monolithic_document(
313
313
}
314
314
}
315
315
316
- let target_url = match target. as_str ( ) {
316
+ let mut target_url = match target. as_str ( ) {
317
317
target_str => match Url :: parse ( target_str) {
318
318
Ok ( target_url) => match target_url. scheme ( ) {
319
319
"data" | "file" | "http" | "https" => target_url,
@@ -362,7 +362,6 @@ pub fn create_monolithic_document(
362
362
363
363
let client: Client = init_client ( options) ;
364
364
let data: Vec < u8 > ;
365
- let mut base_url: Url = target_url. clone ( ) ;
366
365
let document_encoding: Option < String > ;
367
366
368
367
// Retrieve target document
@@ -380,8 +379,9 @@ pub fn create_monolithic_document(
380
379
return Ok ( ( retrieved_data, None ) ) ;
381
380
}
382
381
383
- if options. base_url . clone ( ) . unwrap_or_default ( ) . is_empty ( ) {
384
- base_url = final_url;
382
+ // If got redirected, set target_url to that
383
+ if final_url != target_url {
384
+ target_url = final_url. clone ( ) ;
385
385
}
386
386
387
387
data = retrieved_data;
You can’t perform that action at this time.
0 commit comments