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

request's encoding is corrupt #114

Open
mr-cloud opened this issue Sep 12, 2022 · 3 comments
Open

request's encoding is corrupt #114

mr-cloud opened this issue Sep 12, 2022 · 3 comments

Comments

@mr-cloud
Copy link
Owner

When trying to setup gzip request, I get from server a 400 response:

The request content was malformed:
The request's encoding is corrupt
	at requests.Requester$$anon$1.readBytesThrough(Requester.scala:356)
	at geny.Readable.writeBytesTo(Writable.scala:93)
	at geny.Readable.writeBytesTo$(Writable.scala:93)
	at requests.Requester$$anon$1.writeBytesTo(Requester.scala:165)
	at requests.Requester.apply(Requester.scala:114)

Please see attached simple main that shows the issue.

Note: apache client works find against server, hence I think it's an issue in requests impl
HttpServerRoutingMinimal.zip

ID: 88
Original Author: yairogen
link: Original Link

@mr-cloud
Copy link
Owner Author

@lihaoyi is this a known issue?

Original Author:yairogen

@mr-cloud
Copy link
Owner Author

@yairogen any chance you could provide a build file to go along with the source code? Otherwise I'm not sure how to reproduce
Original Author:lihaoyi

@yairogen
Copy link

@mr-cloud I'm afaraid it's been too long and I don't have source code to give you. I can say that we worked around this by Compressing the string data ourselves with GZIPOutputStream and setting HttpHeaders.CONTENT_ENCODING to "gzip" manually:
something like this:

requests
            .delete(
              url = my_url,
              data = data.get.gzipped(), // this is where we zipped the data ourselves
              sslContext = my_context,
              readTimeout = readTimeout,
              headers = (headers ++ Iterable((HttpHeaders.CONTENT_ENCODING, "gzip"))),
              check = check,
              verifySslCerts = false
            )

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

2 participants