Thread LWP::UserAgent: unterschiedliche Content-Encoding bei Response (28 answers)
Opened by GwenDragon at 2012-10-22 12:40

GwenDragon
 2012-10-22 12:40
#162720 #162720
User since
2005-01-17
14533 Artikel
Admin1
[Homepage]
user image
Linux und Windows 7 ergeben unterschiedliche Content-Encoding in der Response.
Linux zeigt gzip, Windows 7 keines!

Perl 5.10.1
LWP::UserAgent 6.04
HTTP::Message 6.06
Compress::Zlib 2.055

Testcode:
Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/perl

use 5.008;
use strict;
use warnings;

use HTTP::Message;
use LWP::UserAgent;

my $url        = 'http://labs.gwendragon.de/';
my $ua         = LWP::UserAgent->new;
my $can_accept = HTTP::Message::decodable;

my $response = $ua->get( $url, 'Accept-Encoding' => $can_accept, );
print $response->{_headers}->as_string;


Linux-Header:
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Cache-Control: max-age=7200
Connection: close
Date: Mon, 22 Oct 2012 10:32:37 GMT
Accept-Ranges: bytes
ETag: "1c8a880-a09-4bbc1209bb440"
Server: Apache
Vary: Accept-Encoding,User-Agent
Content-Encoding: gzip
Content-Length: 1038
Content-Type: text/html
Expires: Mon, 22 Oct 2012 12:32:37 GMT
Last-Modified: Wed, 21 Mar 2012 13:54:17 GMT
Client-Date: Mon, 22 Oct 2012 10:32:37 GMT
Client-Peer: 213.133.110.246:80
Client-Response-Num: 1
X-Frame-Options: SAMEORIGIN
X-LoadTime: D=726
X-Powered-By: Perl


Windows-Header:
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Cache-Control: max-age=7200
Connection: close
Date: Mon, 22 Oct 2012 10:34:24 GMT
Accept-Ranges: bytes
ETag: "1c8a880-a09-4bbc1209bb440"
Server: Apache
Vary: Accept-Encoding,User-Agent
Content-Length: 2569
Content-Type: text/html
Expires: Mon, 22 Oct 2012 12:34:24 GMT
Last-Modified: Wed, 21 Mar 2012 13:54:17 GMT
Client-Date: Mon, 22 Oct 2012 10:34:11 GMT
Client-Peer: 213.133.110.246:80
Client-Response-Num: 1
Content-Script-Type: text/javascript
Content-Style-Type: text/css
Link: <css/standard.css>; media="all"; rel="stylesheet"; type="text/css"
Link: </favicon.ico>; rel="shortcut icon"; type="image/x-icon"
Title: Domina de Ignis ÔÇô GwenDragons programmatische Hexenk├╝che
X-Frame-Options: SAMEORIGIN
X-LoadTime: D=691
X-Meta-Copyright: (c)2011 by GwenDragon
X-Meta-Description: Testlabor von GwenDragon
X-Meta-Keywords: Programme, Testlabor, Projekte, Bugs, Browser-Bugs
X-Meta-Language: de
X-Meta-Publisher: GwenDragon
X-Meta-Robots: noindex,nofollow
X-Meta-Robots: noarchive
X-Meta-Robots: noodp
X-Powered-By: Perl


Es ist seltsam.

Curl (Win32) liefert:
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
X:\tmp>curl -I -H "Accept-Encoding: gzip,deflate" http://labs.gwendragon.de/
HTTP/1.1 200 OK
Date: Mon, 22 Oct 2012 10:59:46 GMT
Server: Apache
X-Frame-Options: SAMEORIGIN
Last-Modified: Wed, 21 Mar 2012 13:54:17 GMT
ETag: "1c8a880-a09-4bbc1209bb440"
Accept-Ranges: bytes
Cache-Control: max-age=7200
Expires: Mon, 22 Oct 2012 12:59:46 GMT
Vary: Accept-Encoding,User-Agent
Content-Encoding: gzip
X-LoadTime: D=647
X-Powered-By: Perl
Content-Length: 1038
Content-Type: text/html


//EDIT2:
Egal welche Strawberry-Perl-Version ich verwende, LWP zeigt einfach keinerlei gzip in dem Headern an.
Last edited: 2012-10-22 14:59:50 +0200 (CEST)
die Drachin, Gwendolyn


Unterschiedliche Perl-Versionen auf Windows (fast wie perlbrew) • Meine Perl-Artikel

View full thread LWP::UserAgent: unterschiedliche Content-Encoding bei Response