[jira] Issue Comment Edited: (WAGON-264) compressed tarball download problems

2009-06-25 Thread John Casey (JIRA)

[ 
http://jira.codehaus.org/browse/WAGON-264?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=179794#action_179794
 ] 

John Casey edited comment on WAGON-264 at 6/25/09 12:09 PM:


The following headers are set by default in the latest trunk revisions of the 
httpclient-driven wagon (this is the http wagon that will be used in Maven 
2.2.0):

{code}
method.addRequestHeader( Cache-control, no-cache );
method.addRequestHeader( Cache-store, no-store );
method.addRequestHeader( Pragma, no-cache );
method.addRequestHeader( Expires, 0 );
method.addRequestHeader( Accept-Encoding, gzip );
{code}

To disable the Accept-Encoding header, you will have to disable all of these 
default headers, then re-add the ones you want to keep. As of the versions 
checked into trunk, you can do this by editing the settings.xml, like this:

{code:xml}
server
  idmyrepo/id
  configuration
httpConfiguration
  all
useDefaultHeadersfalse/useDefaultHeaders
headers
  header
nameCache-control/name
valueno-cache/value
  /header
  header
nameCache-store/name
valueno-store/value
  /header
  header
namePragma/name
valueno-cache/value
  /header
  header
nameExpires/name
value0/value
  /header
/headers
  /all
/httpConfiguration
  /configuration
/server
{code}

Note that the above configuration will work for wagons accessed through the 
WagonManager in maven-artifact-manager. If you're managing Wagon instances 
elsewhere, you may need to provide access to the new HttpConfiguration and 
HttpMethodConfiguration config classes in wagon-http-shared.

  was (Author: jdcasey):
The following headers are set by default in the latest trunk revisions of 
the httpclient-driven wagon (this is the http wagon that will be used in Maven 
2.2.0):

{code}
method.addRequestHeader( Cache-control, no-cache );
method.addRequestHeader( Cache-store, no-store );
method.addRequestHeader( Pragma, no-cache );
method.addRequestHeader( Expires, 0 );
method.addRequestHeader( Accept-Encoding, gzip );
{code}

To disable the Accept-Encoding header, you will have to disable all of these 
default headers, then re-add the ones you want to keep. As of the versions 
checked into trunk, you can do this by editing the settings.xml, like this:

{code:xml}
server
  idmyrepo/id
  configuration
httpConfiguration
  all
useDefaultHeadersfalse/useDefaultHeaders
headers
  Cache-controlno-cache/Cache-control
  Cache-storeno-store/Cache-store
  Pragmano-cache/Pragma
  Expires0/Expires
/headers
  /all
/httpConfiguration
  /configuration
/server
{code}

Note that the above configuration will work for wagons accessed through the 
WagonManager in maven-artifact-manager. If you're managing Wagon instances 
elsewhere, you may need to provide access to the new HttpConfiguration and 
HttpMethodConfiguration config classes in wagon-http-shared.
  
 compressed tarball download problems
 

 Key: WAGON-264
 URL: http://jira.codehaus.org/browse/WAGON-264
 Project: Maven Wagon
  Issue Type: Improvement
  Components: wagon-http-lightweight
Affects Versions: 1.0-beta-2, 1.0-beta-3, 1.0-beta-4, 1.0-beta-5
Reporter: Lee Thompson
Assignee: John Casey
 Fix For: 1.0-beta-6


 HTTP wagon will uncompress tarballs it downloads, sometimes badly.  
 Downloading openssl results in an unpressed download
 $ mvn -X wagon:download-single -Dwagon.fromFile=openssl-0.9.8k.tar.gz 
 -Dwagon.url=http://www.openssl.org/source -Dwagon.toDir=./
 $ tar tzf openssl-0.9.8k.tar.gz 
 gzip: stdin: not in gzip format
 tar: Child returned status 1
 tar: Error exit delayed from previous errors
 $ tar tf openssl-0.9.8k.tar.gz | more
 openssl-0.9.8k/apps/
 openssl-0.9.8k/apps/app_rand.c
 Downloading expat results in a corrupted file
 mvn -X wagon:download-single -Dwagon.fromFile=expat-1.98.8.tar.gz 
 -Dwagon.url=http://prdownloads.sourceforge.net/expat -Dwagon.toDir=./
 $ tar tf expat-1.98.8.tar.gz 
 tar: This does not look like a tar archive
 tar: Skipping to next header
 tar: Read 1943 bytes from expat-1.98.8.tar.gz
 tar: Error exit delayed from previous errors

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] Issue Comment Edited: (WAGON-264) compressed tarball download problems

2009-05-03 Thread Lee Thompson (JIRA)

[ 
http://jira.codehaus.org/browse/WAGON-264?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=174980#action_174980
 ] 

Lee Thompson edited comment on WAGON-264 at 5/3/09 8:34 AM:


Looks like the client can not see the bypass behavior of mod_gzip.  If you run 
this little groovy program, it will dump the request headers...




URL url = new URL ( 
http://prdownloads.sourceforge.net/expat/expat-1.98.8.tar.gz; );
HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection();
urlConnection.setRequestProperty( Accept-Encoding, gzip );
int responseCode = urlConnection.getResponseCode();
println Response code is  + responseCode
MapString, ListString hdrFields = urlConnection.getHeaderFields()
println hdrFields



output...


Response code is 200
[X-Powered-By:[PHP/5.2.8], 
Set-Cookie:[PHPSESSID=7f4eb0ee669a6363aa7c1e80b4980b0e; expires=Sunday, 
17-May-09 13:23:42 GMT; path=/], X-SFX-Webhead:[sfs-web-7], null:[HTTP/1.1 200 
OK], X-SFX-Revision:[release_20090417], Date:[Sun, 03 May 2009 13:23:42 GMT], 
Pragma:[no-cache], Content-type:[text/html], Cache-Control:[no-store, no-cache, 
must-revalidate, post-check=0, pre-check=0], Content-Encoding:[gzip], 
Expires:[Thu, 19 Nov 1981 08:52:00 GMT], Server:[lighttpd/1.4.19], 
Transfer-Encoding:[chunked], Vary:[Accept-Encoding, User-Agent]]




Suggest a getCompressedFileExtension() method to Resource.java which checks 
the file extenstion for common internet compressed file types like jar, zip, 
gz, tgz, bz2, mp3, etc.  If getCompressedFileExtension() is true, don't ask for 
the gzip encoding and don't check for it either.  This check would be needed 
for http and https.

  was (Author: stimpy):
Looks like the client can not see the bypass behavior of mod_gzip.  If you 
run this little groovy program, it will dump the request headers...


URL url = new URL ( 
http://prdownloads.sourceforge.net/expat/expat-1.98.8.tar.gz; );
HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection();
urlConnection.setRequestProperty( Accept-Encoding, gzip );
int responseCode = urlConnection.getResponseCode();
println Response code is  + responseCode
MapString, ListString hdrFields = urlConnection.getHeaderFields()
println hdrFields



output...


Response code is 200
[X-Powered-By:[PHP/5.2.8], 
Set-Cookie:[PHPSESSID=7f4eb0ee669a6363aa7c1e80b4980b0e; expires=Sunday, 
17-May-09 13:23:42 GMT; path=/], X-SFX-Webhead:[sfs-web-7], null:[HTTP/1.1 200 
OK], X-SFX-Revision:[release_20090417], Date:[Sun, 03 May 2009 13:23:42 GMT], 
Pragma:[no-cache], Content-type:[text/html], Cache-Control:[no-store, no-cache, 
must-revalidate, post-check=0, pre-check=0], Content-Encoding:[gzip], 
Expires:[Thu, 19 Nov 1981 08:52:00 GMT], Server:[lighttpd/1.4.19], 
Transfer-Encoding:[chunked], Vary:[Accept-Encoding, User-Agent]]




Suggest a getCompressedFileExtension() method to Resource.java which checks 
the file extenstion for common internet compressed file types like jar, zip, 
gz, tgz, bz2 and if getCompressedFileExtension() is true, don't as for the gzip 
encoding and don't check for it either.  This check would be needed fro http 
and https.
  
 compressed tarball download problems
 

 Key: WAGON-264
 URL: http://jira.codehaus.org/browse/WAGON-264
 Project: Maven Wagon
  Issue Type: Bug
  Components: wagon-http-lightweight
Affects Versions: 1.0-beta-2, 1.0-beta-3, 1.0-beta-4, 1.0-beta-5
Reporter: Lee Thompson

 HTTP wagon will uncompress tarballs it downloads, sometimes badly.  
 Downloading openssl results in an unpressed download
 $ mvn -X wagon:download-single -Dwagon.fromFile=openssl-0.9.8k.tar.gz 
 -Dwagon.url=http://www.openssl.org/source -Dwagon.toDir=./
 $ tar tzf openssl-0.9.8k.tar.gz 
 gzip: stdin: not in gzip format
 tar: Child returned status 1
 tar: Error exit delayed from previous errors
 $ tar tf openssl-0.9.8k.tar.gz | more
 openssl-0.9.8k/apps/
 openssl-0.9.8k/apps/app_rand.c
 Downloading expat results in a corrupted file
 mvn -X wagon:download-single -Dwagon.fromFile=expat-1.98.8.tar.gz 
 -Dwagon.url=http://prdownloads.sourceforge.net/expat -Dwagon.toDir=./
 $ tar tf expat-1.98.8.tar.gz 
 tar: This does not look like a tar archive
 tar: Skipping to next header
 tar: Read 1943 bytes from expat-1.98.8.tar.gz
 tar: Error exit delayed from previous errors

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira