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

Fixed application/json response header issues #19

Merged
merged 4 commits into from
Aug 8, 2022

Conversation

gary-archer
Copy link
Collaborator

@gary-archer gary-archer commented Jul 12, 2022

For error responses, the application/json response header was written incorrectly.
Fix this by moving the setting of the header before the ngx_http_send_header() call.

Also, for local macOS and local Docker testing, JSON responses were incorrect:

  • There was a missing } in the test JSON response body.
  • The content-type directive in the location block should be set according to this answer.

@gary-archer gary-archer changed the title Fixed 'header already sent while reading response header from upstream' warning in logs Fixed application/json response header issues Jul 12, 2022
@gary-archer gary-archer merged commit 5af1730 into main Aug 8, 2022
@gary-archer gary-archer deleted the fix/header_already_written branch August 8, 2022 10:03
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 this pull request may close these issues.

None yet

1 participant