Update upstream source from tag 'upstream/6.44'
Update to upstream version '6.44'
with Debian dir fe05b5c7b1a2a9e090cf82433ec2358b4dfd7702
gregor herrmann
1 year, 6 months ago
38 | 38 | * Hans-H. Froehlich |
39 | 39 | * Ian Kilgore |
40 | 40 | * Jacob J |
41 | * Jakub Skory | |
41 | 42 | * Jakub Wilk |
42 | 43 | * James Raspass |
43 | 44 | * jefflee |
0 | 0 | Revision history for HTTP-Message |
1 | ||
2 | 6.44 2022-10-26 20:49:00Z | |
3 | - Made the Clone module a hard requirement, so we don't have to | |
4 | provide a fallback function for HTTP::Headers::clone(). | |
5 | We require at least Clone 0.46, as that release now supports | |
6 | Perl back to 5.8.1, just like us. (GH#184) (Neil Bowers) | |
7 | - Import clone from Clone rather than inheriting (GH#189) (Graham Knop) | |
8 | - Made the Compress::Raw::Zlib 2.062 module minimal required | |
9 | version. (GH#190) (Jakub 'q84fh' Skory) | |
10 | ||
11 | 6.43 2022-10-22 14:50:35Z | |
12 | - Remove dependency to IO::Uncompress::Bunzip2. (Michal Josef Spacek) | |
13 | - Remove dependency to IO::Uncompress::Gunzip. (Michal Josef Spacek) | |
14 | ||
15 | 6.42 2022-10-18 13:53:22Z | |
16 | - We now don't consider the Content-Location header when asked | |
17 | for the base URI. RFC 7231 says we shouldn't. (GH#51) (Neil Bowers) | |
18 | - Increased the (max) buffer size for read() when processing form data, | |
19 | from 2048 to 8192. This was suggested in RT#105184, as it improved | |
20 | performance for them. (GH#59) (Neil Bowers) | |
1 | 21 | |
2 | 22 | 6.41 2022-10-12 15:57:40Z |
3 | 23 | - Add maximum size for HTTP::Message->decoded_content |
31 | 31 | }, |
32 | 32 | "develop" : { |
33 | 33 | "requires" : { |
34 | "Clone" : "0", | |
35 | 34 | "File::Spec" : "0", |
36 | 35 | "IO::Handle" : "0", |
37 | 36 | "IPC::Open3" : "0", |
51 | 50 | }, |
52 | 51 | "requires" : { |
53 | 52 | "Carp" : "0", |
53 | "Clone" : "0.46", | |
54 | 54 | "Compress::Raw::Bzip2" : "0", |
55 | "Compress::Raw::Zlib" : "0", | |
55 | "Compress::Raw::Zlib" : "2.062", | |
56 | 56 | "Encode" : "3.01", |
57 | 57 | "Encode::Locale" : "1", |
58 | 58 | "Exporter" : "5.57", |
62 | 62 | "IO::Compress::Deflate" : "0", |
63 | 63 | "IO::Compress::Gzip" : "0", |
64 | 64 | "IO::HTML" : "0", |
65 | "IO::Uncompress::Bunzip2" : "2.021", | |
66 | "IO::Uncompress::Gunzip" : "0", | |
67 | 65 | "IO::Uncompress::Inflate" : "0", |
68 | 66 | "IO::Uncompress::RawInflate" : "0", |
69 | 67 | "LWP::MediaTypes" : "6", |
74 | 72 | "perl" : "5.008001", |
75 | 73 | "strict" : "0", |
76 | 74 | "warnings" : "0" |
77 | }, | |
78 | "suggests" : { | |
79 | "Clone" : "0" | |
80 | 75 | } |
81 | 76 | }, |
82 | 77 | "test" : { |
115 | 110 | "x_IRC" : "irc://irc.perl.org/#lwp", |
116 | 111 | "x_MailingList" : "mailto:libwww@perl.org" |
117 | 112 | }, |
118 | "version" : "6.41", | |
113 | "version" : "6.44", | |
119 | 114 | "x_Dist_Zilla" : { |
120 | 115 | "perl" : { |
121 | 116 | "version" : "5.036000" |
480 | 475 | "changelog" : "Changes" |
481 | 476 | }, |
482 | 477 | "Dist::Zilla::Role::Git::Repo" : { |
483 | "git_version" : "2.38.0", | |
478 | "git_version" : "2.38.1", | |
484 | 479 | "repo_root" : "." |
485 | 480 | } |
486 | 481 | }, |
491 | 486 | "class" : "Dist::Zilla::Plugin::Git::Contributors", |
492 | 487 | "config" : { |
493 | 488 | "Dist::Zilla::Plugin::Git::Contributors" : { |
494 | "git_version" : "2.38.0", | |
489 | "git_version" : "2.38.1", | |
495 | 490 | "include_authors" : 0, |
496 | 491 | "include_releaser" : 1, |
497 | 492 | "order_by" : "name", |
600 | 595 | "changelog" : "Changes" |
601 | 596 | }, |
602 | 597 | "Dist::Zilla::Role::Git::Repo" : { |
603 | "git_version" : "2.38.0", | |
598 | "git_version" : "2.38.1", | |
604 | 599 | "repo_root" : "." |
605 | 600 | }, |
606 | 601 | "Dist::Zilla::Role::Git::StringFormatter" : { |
617 | 612 | "branch" : null, |
618 | 613 | "changelog" : "Changes", |
619 | 614 | "signed" : 0, |
620 | "tag" : "v6.41", | |
615 | "tag" : "v6.44", | |
621 | 616 | "tag_format" : "v%V", |
622 | 617 | "tag_message" : "v%V" |
623 | 618 | }, |
624 | 619 | "Dist::Zilla::Role::Git::Repo" : { |
625 | "git_version" : "2.38.0", | |
620 | "git_version" : "2.38.1", | |
626 | 621 | "repo_root" : "." |
627 | 622 | }, |
628 | 623 | "Dist::Zilla::Role::Git::StringFormatter" : { |
673 | 668 | "changelog" : "Changes" |
674 | 669 | }, |
675 | 670 | "Dist::Zilla::Role::Git::Repo" : { |
676 | "git_version" : "2.38.0", | |
671 | "git_version" : "2.38.1", | |
677 | 672 | "repo_root" : "." |
678 | 673 | }, |
679 | 674 | "Dist::Zilla::Role::Git::StringFormatter" : { |
693 | 688 | "remotes_must_exist" : 1 |
694 | 689 | }, |
695 | 690 | "Dist::Zilla::Role::Git::Repo" : { |
696 | "git_version" : "2.38.0", | |
691 | "git_version" : "2.38.1", | |
697 | 692 | "repo_root" : "." |
698 | 693 | } |
699 | 694 | }, |
700 | 695 | "name" : "@Author::OALDERS/Git::Push", |
701 | 696 | "version" : "2.048" |
702 | }, | |
703 | { | |
704 | "class" : "Dist::Zilla::Plugin::Prereqs::Soften", | |
705 | "config" : { | |
706 | "Dist::Zilla::Plugin::Prereqs::Soften" : { | |
707 | "copy_to" : [ | |
708 | "develop.requires" | |
709 | ], | |
710 | "modules" : [ | |
711 | "Clone" | |
712 | ], | |
713 | "modules_from_features" : null, | |
714 | "to_relationship" : "suggests" | |
715 | } | |
716 | }, | |
717 | "name" : "Prereqs::Soften", | |
718 | "version" : "0.006003" | |
719 | 697 | }, |
720 | 698 | { |
721 | 699 | "class" : "Dist::Zilla::Plugin::Prereqs::Soften", |
861 | 839 | "Hans-H. Froehlich <hfroehlich@co-de-co.de>", |
862 | 840 | "Ian Kilgore <iank@cpan.org>", |
863 | 841 | "Jacob J <waif@chaos2.org>", |
842 | "Jakub Skory <jakub.skory@atos.net>", | |
864 | 843 | "Jakub Wilk <jwilk@jwilk.net>", |
865 | 844 | "James Raspass <jraspass@gmail.com>", |
866 | 845 | "jefflee <shaohua@gmail.com>", |
34 | 34 | IO::Uncompress::Brotli: '0.004001' |
35 | 35 | requires: |
36 | 36 | Carp: '0' |
37 | Clone: '0.46' | |
37 | 38 | Compress::Raw::Bzip2: '0' |
38 | Compress::Raw::Zlib: '0' | |
39 | Compress::Raw::Zlib: '2.062' | |
39 | 40 | Encode: '3.01' |
40 | 41 | Encode::Locale: '1' |
41 | 42 | Exporter: '5.57' |
45 | 46 | IO::Compress::Deflate: '0' |
46 | 47 | IO::Compress::Gzip: '0' |
47 | 48 | IO::HTML: '0' |
48 | IO::Uncompress::Bunzip2: '2.021' | |
49 | IO::Uncompress::Gunzip: '0' | |
50 | 49 | IO::Uncompress::Inflate: '0' |
51 | 50 | IO::Uncompress::RawInflate: '0' |
52 | 51 | LWP::MediaTypes: '6' |
63 | 62 | bugtracker: https://github.com/libwww-perl/HTTP-Message/issues |
64 | 63 | homepage: https://github.com/libwww-perl/HTTP-Message |
65 | 64 | repository: https://github.com/libwww-perl/HTTP-Message.git |
66 | version: '6.41' | |
65 | version: '6.44' | |
67 | 66 | x_Dist_Zilla: |
68 | 67 | perl: |
69 | 68 | version: '5.036000' |
347 | 346 | allow_dirty_match: [] |
348 | 347 | changelog: Changes |
349 | 348 | Dist::Zilla::Role::Git::Repo: |
350 | git_version: 2.38.0 | |
349 | git_version: 2.38.1 | |
351 | 350 | repo_root: . |
352 | 351 | name: '@Author::OALDERS/Git::Check' |
353 | 352 | version: '2.048' |
355 | 354 | class: Dist::Zilla::Plugin::Git::Contributors |
356 | 355 | config: |
357 | 356 | Dist::Zilla::Plugin::Git::Contributors: |
358 | git_version: 2.38.0 | |
357 | git_version: 2.38.1 | |
359 | 358 | include_authors: 0 |
360 | 359 | include_releaser: 1 |
361 | 360 | order_by: name |
439 | 438 | allow_dirty_match: [] |
440 | 439 | changelog: Changes |
441 | 440 | Dist::Zilla::Role::Git::Repo: |
442 | git_version: 2.38.0 | |
441 | git_version: 2.38.1 | |
443 | 442 | repo_root: . |
444 | 443 | Dist::Zilla::Role::Git::StringFormatter: |
445 | 444 | time_zone: local |
452 | 451 | branch: ~ |
453 | 452 | changelog: Changes |
454 | 453 | signed: 0 |
455 | tag: v6.41 | |
454 | tag: v6.44 | |
456 | 455 | tag_format: v%V |
457 | 456 | tag_message: v%V |
458 | 457 | Dist::Zilla::Role::Git::Repo: |
459 | git_version: 2.38.0 | |
458 | git_version: 2.38.1 | |
460 | 459 | repo_root: . |
461 | 460 | Dist::Zilla::Role::Git::StringFormatter: |
462 | 461 | time_zone: local |
494 | 493 | - (?^:^lib/.*\.pm$) |
495 | 494 | changelog: Changes |
496 | 495 | Dist::Zilla::Role::Git::Repo: |
497 | git_version: 2.38.0 | |
496 | git_version: 2.38.1 | |
498 | 497 | repo_root: . |
499 | 498 | Dist::Zilla::Role::Git::StringFormatter: |
500 | 499 | time_zone: local |
508 | 507 | - origin |
509 | 508 | remotes_must_exist: 1 |
510 | 509 | Dist::Zilla::Role::Git::Repo: |
511 | git_version: 2.38.0 | |
510 | git_version: 2.38.1 | |
512 | 511 | repo_root: . |
513 | 512 | name: '@Author::OALDERS/Git::Push' |
514 | 513 | version: '2.048' |
515 | - | |
516 | class: Dist::Zilla::Plugin::Prereqs::Soften | |
517 | config: | |
518 | Dist::Zilla::Plugin::Prereqs::Soften: | |
519 | copy_to: | |
520 | - develop.requires | |
521 | modules: | |
522 | - Clone | |
523 | modules_from_features: ~ | |
524 | to_relationship: suggests | |
525 | name: Prereqs::Soften | |
526 | version: '0.006003' | |
527 | 514 | - |
528 | 515 | class: Dist::Zilla::Plugin::Prereqs::Soften |
529 | 516 | config: |
642 | 629 | - 'Hans-H. Froehlich <hfroehlich@co-de-co.de>' |
643 | 630 | - 'Ian Kilgore <iank@cpan.org>' |
644 | 631 | - 'Jacob J <waif@chaos2.org>' |
632 | - 'Jakub Skory <jakub.skory@atos.net>' | |
645 | 633 | - 'Jakub Wilk <jwilk@jwilk.net>' |
646 | 634 | - 'James Raspass <jraspass@gmail.com>' |
647 | 635 | - 'jefflee <shaohua@gmail.com>' |
17 | 17 | "NAME" => "HTTP::Message", |
18 | 18 | "PREREQ_PM" => { |
19 | 19 | "Carp" => 0, |
20 | "Clone" => "0.46", | |
20 | 21 | "Compress::Raw::Bzip2" => 0, |
21 | "Compress::Raw::Zlib" => 0, | |
22 | "Compress::Raw::Zlib" => "2.062", | |
22 | 23 | "Encode" => "3.01", |
23 | 24 | "Encode::Locale" => 1, |
24 | 25 | "Exporter" => "5.57", |
28 | 29 | "IO::Compress::Deflate" => 0, |
29 | 30 | "IO::Compress::Gzip" => 0, |
30 | 31 | "IO::HTML" => 0, |
31 | "IO::Uncompress::Bunzip2" => "2.021", | |
32 | "IO::Uncompress::Gunzip" => 0, | |
33 | 32 | "IO::Uncompress::Inflate" => 0, |
34 | 33 | "IO::Uncompress::RawInflate" => 0, |
35 | 34 | "LWP::MediaTypes" => 6, |
53 | 52 | "lib" => 0, |
54 | 53 | "overload" => 0 |
55 | 54 | }, |
56 | "VERSION" => "6.41", | |
55 | "VERSION" => "6.44", | |
57 | 56 | "test" => { |
58 | 57 | "TESTS" => "t/*.t" |
59 | 58 | } |
62 | 61 | |
63 | 62 | my %FallbackPrereqs = ( |
64 | 63 | "Carp" => 0, |
64 | "Clone" => "0.46", | |
65 | 65 | "Compress::Raw::Bzip2" => 0, |
66 | "Compress::Raw::Zlib" => 0, | |
66 | "Compress::Raw::Zlib" => "2.062", | |
67 | 67 | "Encode" => "3.01", |
68 | 68 | "Encode::Locale" => 1, |
69 | 69 | "Exporter" => "5.57", |
75 | 75 | "IO::Compress::Deflate" => 0, |
76 | 76 | "IO::Compress::Gzip" => 0, |
77 | 77 | "IO::HTML" => 0, |
78 | "IO::Uncompress::Bunzip2" => "2.021", | |
79 | "IO::Uncompress::Gunzip" => 0, | |
80 | 78 | "IO::Uncompress::Inflate" => 0, |
81 | 79 | "IO::Uncompress::RawInflate" => 0, |
82 | 80 | "LWP::MediaTypes" => 6, |
1 | 1 | # Do not edit this file directly. To change prereqs, edit the `dist.ini` file. |
2 | 2 | |
3 | 3 | requires "Carp" => "0"; |
4 | requires "Clone" => "0.46"; | |
4 | 5 | requires "Compress::Raw::Bzip2" => "0"; |
5 | requires "Compress::Raw::Zlib" => "0"; | |
6 | requires "Compress::Raw::Zlib" => "2.062"; | |
6 | 7 | requires "Encode" => "3.01"; |
7 | 8 | requires "Encode::Locale" => "1"; |
8 | 9 | requires "Exporter" => "5.57"; |
12 | 13 | requires "IO::Compress::Deflate" => "0"; |
13 | 14 | requires "IO::Compress::Gzip" => "0"; |
14 | 15 | requires "IO::HTML" => "0"; |
15 | requires "IO::Uncompress::Bunzip2" => "2.021"; | |
16 | requires "IO::Uncompress::Gunzip" => "0"; | |
17 | 16 | requires "IO::Uncompress::Inflate" => "0"; |
18 | 17 | requires "IO::Uncompress::RawInflate" => "0"; |
19 | 18 | requires "LWP::MediaTypes" => "6"; |
26 | 25 | requires "warnings" => "0"; |
27 | 26 | recommends "IO::Compress::Brotli" => "0.004001"; |
28 | 27 | recommends "IO::Uncompress::Brotli" => "0.004001"; |
29 | suggests "Clone" => "0"; | |
30 | 28 | |
31 | 29 | on 'test' => sub { |
32 | 30 | requires "ExtUtils::MakeMaker" => "0"; |
59 | 57 | }; |
60 | 58 | |
61 | 59 | on 'develop' => sub { |
62 | requires "Clone" => "0"; | |
63 | 60 | requires "File::Spec" => "0"; |
64 | 61 | requires "IO::Handle" => "0"; |
65 | 62 | requires "IPC::Open3" => "0"; |
9 | 9 | x_MailingList = mailto:libwww@perl.org |
10 | 10 | |
11 | 11 | [Prereqs] |
12 | Compress::Raw::Zlib = 0 | |
12 | Compress::Raw::Zlib = 2.062 | |
13 | 13 | Encode = 3.01 |
14 | 14 | Encode::Locale = 1 |
15 | 15 | Exporter = 5.57 |
17 | 17 | IO::Compress::Brotli = 0.004001 |
18 | 18 | IO::Compress::Bzip2 = 2.021 |
19 | 19 | IO::Uncompress::Brotli = 0.004001 |
20 | IO::Uncompress::Bunzip2 = 2.021 | |
21 | 20 | LWP::MediaTypes = 6 |
22 | 21 | MIME::Base64 = 2.1 |
23 | 22 | perl = 5.008001 |
24 | 23 | URI = 1.10 |
24 | Clone = 0.46 | |
25 | 25 | |
26 | 26 | [@Author::OALDERS] |
27 | 27 | ; all these tests are TODO |
34 | 34 | -remove = Test::TidyAll |
35 | 35 | StaticInstall.mode = on |
36 | 36 | StaticInstall.dry_run = 0 |
37 | ||
38 | [Prereqs::Soften] | |
39 | to_relationship = suggests | |
40 | copy_to = develop.requires | |
41 | module = Clone | |
42 | 37 | |
43 | 38 | [Prereqs::Soften / Brotli] |
44 | 39 | to_relationship = recommends |
2 | 2 | use strict; |
3 | 3 | use warnings; |
4 | 4 | |
5 | our $VERSION = '6.41'; | |
5 | our $VERSION = '6.44'; | |
6 | 6 | |
7 | 7 | use URI; |
8 | 8 | |
248 | 248 | |
249 | 249 | =head1 VERSION |
250 | 250 | |
251 | version 6.41 | |
251 | version 6.44 | |
252 | 252 | |
253 | 253 | =head1 SYNOPSIS |
254 | 254 |
2 | 2 | use strict; |
3 | 3 | use warnings; |
4 | 4 | |
5 | our $VERSION = '6.41'; | |
5 | our $VERSION = '6.44'; | |
6 | 6 | |
7 | 7 | use HTTP::Headers; |
8 | 8 | |
110 | 110 | |
111 | 111 | =head1 VERSION |
112 | 112 | |
113 | version 6.41 | |
113 | version 6.44 | |
114 | 114 | |
115 | 115 | =head1 AUTHOR |
116 | 116 |
2 | 2 | use strict; |
3 | 3 | use warnings; |
4 | 4 | |
5 | our $VERSION = '6.41'; | |
5 | our $VERSION = '6.44'; | |
6 | 6 | |
7 | 7 | require HTTP::Date; |
8 | 8 | |
106 | 106 | |
107 | 107 | =head1 VERSION |
108 | 108 | |
109 | version 6.41 | |
109 | version 6.44 | |
110 | 110 | |
111 | 111 | =head1 AUTHOR |
112 | 112 |
2 | 2 | use strict; |
3 | 3 | use warnings; |
4 | 4 | |
5 | our $VERSION = '6.41'; | |
5 | our $VERSION = '6.44'; | |
6 | 6 | |
7 | 7 | use Exporter 5.57 'import'; |
8 | 8 | |
102 | 102 | |
103 | 103 | =head1 VERSION |
104 | 104 | |
105 | version 6.41 | |
105 | version 6.44 | |
106 | 106 | |
107 | 107 | =head1 SYNOPSIS |
108 | 108 |
2 | 2 | use strict; |
3 | 3 | use warnings; |
4 | 4 | |
5 | our $VERSION = '6.41'; | |
6 | ||
5 | our $VERSION = '6.44'; | |
6 | ||
7 | use Clone qw(clone); | |
7 | 8 | use Carp (); |
8 | 9 | |
9 | 10 | # The $TRANSLATE_UNDERSCORE variable controls whether '_' can be used |
297 | 298 | } |
298 | 299 | |
299 | 300 | |
300 | ||
301 | if (eval { require Clone; 1 }) { | |
302 | *clone = \&Clone::clone; | |
303 | } else { | |
304 | *clone = sub { | |
305 | my $self = shift; | |
306 | my $clone = HTTP::Headers->new; | |
307 | $self->scan(sub { $clone->push_header(@_);} ); | |
308 | $clone; | |
309 | }; | |
310 | } | |
311 | ||
312 | ||
313 | 301 | sub _date_header |
314 | 302 | { |
315 | 303 | require HTTP::Date; |
474 | 462 | |
475 | 463 | =head1 VERSION |
476 | 464 | |
477 | version 6.41 | |
465 | version 6.44 | |
478 | 466 | |
479 | 467 | =head1 SYNOPSIS |
480 | 468 |
2 | 2 | use strict; |
3 | 3 | use warnings; |
4 | 4 | |
5 | our $VERSION = '6.41'; | |
5 | our $VERSION = '6.44'; | |
6 | 6 | |
7 | 7 | require HTTP::Headers; |
8 | 8 | require Carp; |
492 | 492 | # XXX preferably we should determine if the modules are available without loading |
493 | 493 | # them here |
494 | 494 | eval { |
495 | require IO::Uncompress::Gunzip; | |
495 | require Compress::Raw::Zlib; | |
496 | 496 | push(@enc, "gzip", "x-gzip"); |
497 | 497 | }; |
498 | 498 | eval { |
501 | 501 | push(@enc, "deflate"); |
502 | 502 | }; |
503 | 503 | eval { |
504 | require IO::Uncompress::Bunzip2; | |
504 | require Compress::Raw::Bzip2; | |
505 | 505 | push(@enc, "x-bzip2", "bzip2"); |
506 | 506 | }; |
507 | 507 | eval { |
883 | 883 | |
884 | 884 | =head1 VERSION |
885 | 885 | |
886 | version 6.41 | |
886 | version 6.44 | |
887 | 887 | |
888 | 888 | =head1 SYNOPSIS |
889 | 889 |
2 | 2 | use strict; |
3 | 3 | use warnings; |
4 | 4 | |
5 | our $VERSION = '6.41'; | |
5 | our $VERSION = '6.44'; | |
6 | 6 | |
7 | 7 | our $DYNAMIC_FILE_UPLOAD ||= 0; # make it defined (don't know why) |
8 | our $READ_BUFFER_SIZE = 8192; | |
8 | 9 | |
9 | 10 | use Exporter 5.57 'import'; |
10 | 11 | |
252 | 253 | binmode($fh); |
253 | 254 | } |
254 | 255 | my $buflength = length $buf; |
255 | my $n = read($fh, $buf, 2048, $buflength); | |
256 | my $n = read($fh, $buf, $READ_BUFFER_SIZE, $buflength); | |
256 | 257 | if ($n) { |
257 | 258 | $buflength += $n; |
258 | 259 | unshift(@parts, ["", $fh]); |
313 | 314 | |
314 | 315 | =head1 VERSION |
315 | 316 | |
316 | version 6.41 | |
317 | version 6.44 | |
317 | 318 | |
318 | 319 | =head1 SYNOPSIS |
319 | 320 |
2 | 2 | use strict; |
3 | 3 | use warnings; |
4 | 4 | |
5 | our $VERSION = '6.41'; | |
5 | our $VERSION = '6.44'; | |
6 | 6 | |
7 | 7 | use parent 'HTTP::Message'; |
8 | 8 | |
154 | 154 | |
155 | 155 | =head1 VERSION |
156 | 156 | |
157 | version 6.41 | |
157 | version 6.44 | |
158 | 158 | |
159 | 159 | =head1 SYNOPSIS |
160 | 160 |
2 | 2 | use strict; |
3 | 3 | use warnings; |
4 | 4 | |
5 | our $VERSION = '6.41'; | |
5 | our $VERSION = '6.44'; | |
6 | 6 | |
7 | 7 | use parent 'HTTP::Message'; |
8 | 8 | |
83 | 83 | my $self = shift; |
84 | 84 | my $base = ( |
85 | 85 | $self->header('Content-Base'), # used to be HTTP/1.1 |
86 | $self->header('Content-Location'), # HTTP/1.1 | |
87 | 86 | $self->header('Base'), # HTTP/1.0 |
88 | 87 | )[0]; |
89 | 88 | if ($base && $base =~ /^$URI::scheme_re:/o) { |
350 | 349 | |
351 | 350 | =head1 VERSION |
352 | 351 | |
353 | version 6.41 | |
352 | version 6.44 | |
354 | 353 | |
355 | 354 | =head1 SYNOPSIS |
356 | 355 | |
481 | 480 | |
482 | 481 | =item 2. |
483 | 482 | |
484 | A "Content-Base:" or a "Content-Location:" header in the response. | |
483 | A "Content-Base:" header in the response. | |
485 | 484 | |
486 | 485 | For backwards compatibility with older HTTP implementations we will |
487 | 486 | also look for the "Base:" header. |
495 | 494 | =back |
496 | 495 | |
497 | 496 | If none of these sources provide an absolute URI, undef is returned. |
497 | ||
498 | B<Note>: previous versions of HTTP::Response would also consider | |
499 | a "Content-Location:" header, | |
500 | as L<RFC 2616|https://www.rfc-editor.org/rfc/rfc2616> said it should be. | |
501 | But this was never widely implemented by browsers, | |
502 | and now L<RFC 7231|https://www.rfc-editor.org/rfc/rfc7231> | |
503 | says it should no longer be considered. | |
498 | 504 | |
499 | 505 | When the LWP protocol modules produce the HTTP::Response object, then any base |
500 | 506 | URI embedded in the document (step 1) will already have initialized the |
2 | 2 | use strict; |
3 | 3 | use warnings; |
4 | 4 | |
5 | our $VERSION = '6.41'; | |
5 | our $VERSION = '6.44'; | |
6 | 6 | |
7 | 7 | use Exporter 5.57 'import'; |
8 | 8 | |
180 | 180 | |
181 | 181 | =head1 VERSION |
182 | 182 | |
183 | version 6.41 | |
183 | version 6.44 | |
184 | 184 | |
185 | 185 | =head1 SYNOPSIS |
186 | 186 |
9 | 9 | }, |
10 | 10 | 'develop' => { |
11 | 11 | 'requires' => { |
12 | 'Clone' => '0', | |
13 | 12 | 'File::Spec' => '0', |
14 | 13 | 'IO::Handle' => '0', |
15 | 14 | 'IPC::Open3' => '0', |
29 | 28 | }, |
30 | 29 | 'requires' => { |
31 | 30 | 'Carp' => '0', |
31 | 'Clone' => '0.46', | |
32 | 32 | 'Compress::Raw::Bzip2' => '0', |
33 | 'Compress::Raw::Zlib' => '0', | |
33 | 'Compress::Raw::Zlib' => '2.062', | |
34 | 34 | 'Encode' => '3.01', |
35 | 35 | 'Encode::Locale' => '1', |
36 | 36 | 'Exporter' => '5.57', |
40 | 40 | 'IO::Compress::Deflate' => '0', |
41 | 41 | 'IO::Compress::Gzip' => '0', |
42 | 42 | 'IO::HTML' => '0', |
43 | 'IO::Uncompress::Bunzip2' => '2.021', | |
44 | 'IO::Uncompress::Gunzip' => '0', | |
45 | 43 | 'IO::Uncompress::Inflate' => '0', |
46 | 44 | 'IO::Uncompress::RawInflate' => '0', |
47 | 45 | 'LWP::MediaTypes' => '6', |
52 | 50 | 'perl' => '5.008001', |
53 | 51 | 'strict' => '0', |
54 | 52 | 'warnings' => '0' |
55 | }, | |
56 | 'suggests' => { | |
57 | 'Clone' => '0' | |
58 | 53 | } |
59 | 54 | }, |
60 | 55 | 'test' => { |
230 | 230 | #note int(@chunks), " chunks, total size is ", length($_), " bytes\n"; |
231 | 231 | |
232 | 232 | # should be close to expected size and number of chunks |
233 | cmp_ok(abs(@chunks - 15), '<', 3); | |
233 | cmp_ok(abs(@chunks - 6), '<', 3); | |
234 | 234 | cmp_ok(abs(length($_) - 26589), '<', 20); |
235 | 235 | |
236 | 236 | $r = POST 'http://www.example.com'; |
7 | 7 | use HTTP::Headers qw( ); |
8 | 8 | use HTTP::Response qw( ); |
9 | 9 | |
10 | use Test::Needs { 'Compress::Raw::Zlib' => '2.061' }; | |
10 | use Test::Needs { 'Compress::Raw::Zlib' => '2.062' }; | |
11 | 11 | plan tests => 9; |
12 | 12 | |
13 | 13 | # Create a nasty gzip stream: |
499 | 499 | ok(!$m->header("Client-Warning")); |
500 | 500 | |
501 | 501 | |
502 | if (eval "require IO::Uncompress::Bunzip2") { | |
502 | if (eval "require Compress::Raw::Bzip2") { | |
503 | 503 | for my $encoding (qw/x-bzip2 bzip2/) { |
504 | 504 | $m = HTTP::Message->new([ |
505 | 505 | "Content-Type" => "text/plain", |
530 | 530 | } |
531 | 531 | } |
532 | 532 | else { |
533 | skip("Need IO::Uncompress::Bunzip2", undef) for 1..18; | |
533 | skip("Need Compress::Raw::Bzip2", undef) for 1..18; | |
534 | 534 | } |
535 | 535 | |
536 | 536 | # test decoding of XML content |
15 | 15 | is( $req->method, "GET" ); |
16 | 16 | is( $req->uri, "http://www.example.com" ); |
17 | 17 | like( $req->header("Accept-Encoding"), qr/\bgzip\b/ ) |
18 | ; # assuming IO::Uncompress::Gunzip is there | |
18 | ; # assuming Compress::Raw::Zlib is there | |
19 | 19 | |
20 | 20 | $req->dump( prefix => "# " ); |
21 | 21 |
104 | 104 | |
105 | 105 | is($r->base, $r->request->uri); |
106 | 106 | $r->push_header("Content-Location", "/1/A/a"); |
107 | is($r->base, "http://www.sn.no/1/A/a"); | |
107 | is($r->base, $r->request->uri); # we no longer consider Content-Location | |
108 | 108 | $r->push_header("Content-Base", "/2/;a=/foo/bar"); |
109 | 109 | is($r->base, "http://www.sn.no/2/;a=/foo/bar"); |
110 | 110 | $r->push_header("Content-Base", "/3/"); |