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

[TW#26634] Got application/json as default response content type #2527

Closed
trinhvc opened this issue Oct 6, 2018 · 2 comments
Closed

[TW#26634] Got application/json as default response content type #2527

trinhvc opened this issue Oct 6, 2018 · 2 comments

Comments

@trinhvc
Copy link

trinhvc commented Oct 6, 2018

Hi,
I'm having a problem with http server in the master branch. That is:
As stated in following function's description: httpd_resp_send, httpd_resp_send_chunk, httpd_resp_set_type; If no status code and content-type were set, the default content type is 'text/html'.

But when I send response without setting the content type as below:
httpd_resp_send(req, buf, buf_len);
The content type I get is application/json

I found that there may be a mistake here in file httpd_parse.c, line 570:
ra->content_type = (char *)HTTPD_TYPE_JSON;

I don't know if anyone having the same problem like me.
Or could any one confirm about the issue.
Thank you,

@chegewara
Copy link
Contributor

@anurag-kar
Copy link
Contributor

Yes , that seems like a mistake. Line 570 should read

ra->content_type = (char *)HTTPD_TYPE_TEXT;

Thanks for letting us know. Will fix this issue ASAP

@Alvin1Zhang Alvin1Zhang changed the title Got application/json as default response content type [TW#26634] Got application/json as default response content type Oct 8, 2018
@igrr igrr closed this as completed in 8be9e09 Oct 18, 2018
catalinio pushed a commit to catalinio/pycom-esp-idf that referenced this issue Jun 28, 2019
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

3 participants