Skip to content
New issue

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

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

Already on GitHub? # to your account

Fix text plain decoding #824

Merged
merged 3 commits into from
Sep 5, 2023
Merged

Fix text plain decoding #824

merged 3 commits into from
Sep 5, 2023

Conversation

umbynos
Copy link
Contributor

@umbynos umbynos commented Sep 5, 2023

Please check if the PR fulfills these requirements

  • The PR has no duplicates (please search among the Pull Requests
    before creating one)
  • Tests for the changes have been added (for bug fixes / features)
  • What kind of change does this PR introduce?

Bug fix

  • What is the current behavior?

The frontend for some reason sends requests with "text/plain" content type header. With #815 a new Decoder for that content type was implemented. This breaks the current version of the agent. This needs fixing in the frontend, but nonetheless the change of #815 was a breaking one.

  • What is the new behavior?

use a CustomRequestDecoder to handle properly the misbehaving requests of the Web Editor
The requests sent uses text/plain Content-Type when they should be using application/json
This commit restores the old behavior, using always a json Decoder

  • Does this PR introduce a breaking change?

no

  • Other information:

@umbynos umbynos added topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project labels Sep 5, 2023
@umbynos umbynos self-assigned this Sep 5, 2023
…s of the Web Editor

The requests sent uses `text/plain` Content-Type when they should be using `application/json`
This commit restores the old behavior, using always a json Decoder
@umbynos umbynos force-pushed the fix-text-plain-decoding branch from 05344f2 to 98fdf66 Compare September 5, 2023 12:51
@codecov-commenter
Copy link

codecov-commenter commented Sep 5, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +5.73% 🎉

Comparison is base (b1ece84) 11.14% compared to head (98fdf66) 16.88%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #824      +/-   ##
==========================================
+ Coverage   11.14%   16.88%   +5.73%     
==========================================
  Files          53       53              
  Lines        4073     4075       +2     
==========================================
+ Hits          454      688     +234     
+ Misses       3563     3287     -276     
- Partials       56      100      +44     
Flag Coverage Δ
unit 16.88% <100.00%> (+5.73%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
v2/http.go 87.50% <100.00%> (+87.50%) ⬆️

... and 10 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@alessio-perugini alessio-perugini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

@umbynos umbynos merged commit 08422e6 into main Sep 5, 2023
@umbynos umbynos deleted the fix-text-plain-decoding branch September 5, 2023 13:16
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants