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

Unhandled Exception: FormatException: Unexpected extension byte (at offset 1) #113

Closed
zhukeev opened this issue May 12, 2022 · 3 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@zhukeev
Copy link

zhukeev commented May 12, 2022

Describe the bug
A clear and concise description of what the bug is.
Can't send encoded body with GZipCodec().encode(utf8.encode( json.encode(body), ))
but http can
To Reproduce
Steps to reproduce the behavior:

  1. Encode body with GZipCodec().encode(utf8.encode( json.encode(body),))
  2. Make post request
  3. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Please complete the following information):

  • Flutter version: 2.10.4
  • IDE: VS Code
  • http_interceptor: ^2.0.0-beta.5

Additional context
Add any other context about the problem here.

@zhukeev zhukeev added the bug Something isn't working label May 12, 2022
@CodingAleCR
Copy link
Owner

Hey, thanks for creating an issue for this. I will take a look as soon as I can.

@CodingAleCR
Copy link
Owner

Hey, are you able to provide a bit more context of what are you seeing from your side, like how is the error presented in your case.

@CodingAleCR
Copy link
Owner

Hey @zhukeev this seems to be an exception coming straight from the SDK, not a problem from the library. In any case, digging a bit online I found this SO thread that might help you solve your issues.

As a bonus, I've added a test for checking GZip compression in #114 . This test takes the approach recommended in the thread I just linked and worked like a charm for fixing the exception you were having (from what I could reproduce).

As this is not exactly the library's fault, I'll close the issue and pin it for others in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants