Skip to content
This repository has been archived by the owner on Mar 16, 2019. It is now read-only.

Content-Type of goat.WriteError not application/json #4

Closed
robintemme opened this issue Apr 29, 2015 · 2 comments
Closed

Content-Type of goat.WriteError not application/json #4

robintemme opened this issue Apr 29, 2015 · 2 comments

Comments

@robintemme
Copy link
Collaborator

Somehow goat.WriteErrorseems to not set the Content-Type-header correctly to application/json.

Could you verify this?

@bahlo
Copy link
Owner

bahlo commented Apr 29, 2015

Hey @zwerch,

I think it's the w.WriteHeader() method here, which permits the change of headers afterwards.

A solution could be to write a private method which writes and takes an error code and a JSON interface.
This way WriteError and WriteJSON could access that method and we'd have no duplicate header writes.

bahlo added a commit that referenced this issue Mar 21, 2016
* 1.0.7-development:
  🐛 Add header as fix for #4, WriteJSONWithStatus
@bahlo
Copy link
Owner

bahlo commented Mar 21, 2016

Fixed in 1.0.7.

@bahlo bahlo closed this as completed Mar 21, 2016
robintemme added a commit to robintemme/goat that referenced this issue Apr 6, 2016
Also set headers correctly, completely fixing bahlo#4. 🐛
robintemme added a commit to robintemme/goat that referenced this issue Apr 6, 2016
Also set headers correctly, completely fixing bahlo#4. 🐛
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants