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

Incorrect Content-Type headers #145

Closed
RA80533 opened this issue Jun 16, 2021 · 7 comments · Fixed by #149
Closed

Incorrect Content-Type headers #145

RA80533 opened this issue Jun 16, 2021 · 7 comments · Fixed by #149

Comments

@RA80533
Copy link
Contributor

RA80533 commented Jun 16, 2021

web.js uses incorrect headers to describe the Content-Type of the JSON payload.

@drazisil
Copy link
Contributor

It you are referring to the PUT, the comment on

.send(uploadFile) // sends a JSON post body
is the incorrect part. The PUT does send a gzip

@RA80533
Copy link
Contributor Author

RA80533 commented Jun 18, 2021

Content-Type specifies the original content type whereas Content-Encoding specifies the compression, etc.

Content-Type should be JSON.

In terms of semantics, it might help to think of Content-Encoding as simply a box for whatever content it holds. There’s no such thing as sending “a gzip” because a gzip isn’t a thing itself—it’s what it contains that’s being sent, etc.

@RA80533
Copy link
Contributor Author

RA80533 commented Jun 18, 2021

If the Content-Type is not being handled in a way that respects the actual content of the underlying content type of what’s being sent, do the back-end services just assume that the content being uploaded is JSON?

@drazisil
Copy link
Contributor

The content can be a mix of things, not just JSON. It can be XML, text, JSON, etc. Any format that a coverage report can be in, and often serveral types in the same gzip. What would you propose in this case?

@drazisil
Copy link
Contributor

Actually, I misspoke. The content is always text. What indicates to you that it is JSON?

@RA80533
Copy link
Contributor Author

RA80533 commented Jun 18, 2021

Simply based on that comment. If it's actually just a stream of text, line 41 and 69 should be changed to text/plain.

@drazisil
Copy link
Contributor

drazisil commented Jun 18, 2021

Got it. Thank you for explaining, @RA80533 :)

drazisil-codecov pushed a commit that referenced this issue Jun 22, 2021
* fix: correct headers

Fixes #145
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

Successfully merging a pull request may close this issue.

2 participants