1Plack::Middleware::RearUrsaenrgeCHoenatdreirbsu(t3e)d PePrllacDko:c:uMmiedndtlaetwiaorne::RearrangeHeaders(3)
2
3
4
6 Plack::Middleware::RearrangeHeaders - Reorder HTTP headers for buggy
7 clients
8
10 use Plack::Builder;
11
12 my $app = sub {
13 return [ 200, [
14 'Last-Modified' => 'Wed, 23 Sep 2009 13:36:33 GMT',
15 'Content-Type' => 'text/plain',
16 'ETag' => 'foo bar',
17 ], [ 'Hello Foo' ] ];
18 };
19
20 builder {
21 enable "Plack::Middleware::RearrangeHeaders";
22 $app;
23 };
24
26 Plack::Middleware::RearrangeHeaders sorts HTTP headers based on "Good
27 Practice" i.e.:
28
29 # "Good Practice" order of HTTP message headers:
30 # - Response-Headers
31 # - Entity-Headers
32
33 to work around buggy clients like very old MSIE or broken HTTP proxy
34 servers. Most clients today don't (and shouldn't) care about HTTP
35 header order but if you're too pedantic or have some environments where
36 you need to deal with buggy clients like above, this might be useful.
37
39 Tatsuhiko Miyagawa
40
42 HTTP::Headers
43
44
45
46perl v5.30.1 2020-01P-l3a0ck::Middleware::RearrangeHeaders(3)