Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EOFException on HEAD with gzip encoding #119

Closed
mr-cloud opened this issue Sep 12, 2022 · 1 comment
Closed

EOFException on HEAD with gzip encoding #119

mr-cloud opened this issue Sep 12, 2022 · 1 comment

Comments

@mr-cloud
Copy link
Owner

Welcome to the Ammonite Repl 2.4.1 (Scala 2.13.7 Java 11.0.14.1)
@ requests.head("https://google.com/").statusCode 
res0: Int = 200

@ requests.head("https://mozilla.org/").statusCode 
java.io.EOFException
  java.util.zip.GZIPInputStream.readUByte(GZIPInputStream.java:269)
  java.util.zip.GZIPInputStream.readUShort(GZIPInputStream.java:259)
  java.util.zip.GZIPInputStream.readHeader(GZIPInputStream.java:165)
  java.util.zip.GZIPInputStream.<init>(GZIPInputStream.java:80)
  java.util.zip.GZIPInputStream.<init>(GZIPInputStream.java:92)
  requests.Requester$$anon$1.processWrappedStream$1(Requester.scala:336)
  requests.Requester$$anon$1.readBytesThrough(Requester.scala:345)
  requests.Requester$$anon$1.readBytesThrough(Requester.scala:317)
  requests.Requester$$anon$1.readBytesThrough(Requester.scala:317)
  geny.Readable.writeBytesTo(Writable.scala:93)
  geny.Readable.writeBytesTo$(Writable.scala:93)
  requests.Requester$$anon$1.writeBytesTo(Requester.scala:165)
  requests.Requester.apply(Requester.scala:114)
  ammonite.$sess.cmd1$.<clinit>(cmd1.sc:1)

Might be similar to kittinunf/fuel#177 since

$ curl -s -i -k -I -H "Accept-Encoding:gzip" "https://www.google.com/" | grep encoding
$ curl -s -i -k -I -H "Accept-Encoding:gzip" "https://www.mozilla.org/en-US/" | grep encoding
content-encoding: gzip
$ 

ID: 104
Original Author: tempaccount172
link: Original Link

@mr-cloud
Copy link
Owner Author

I just saw that this is a duplicate of com-lihaoyi/requests-scala#37 and is fixed in the newest release of Ammonite, probably older ones too.

Welcome to the Ammonite Repl 2.5.3 (Scala 2.13.8 Java 11.0.14.1)
@ requests.head("https://google.com/").statusCode 
res0: Int = 200

@ requests.head("https://mozilla.org/").statusCode 
res1: Int = 200

Original Author:tempaccount172

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant