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

Where should body and headers be set? #4

Closed
andreineculau opened this issue Feb 18, 2013 · 1 comment
Closed

Where should body and headers be set? #4

andreineculau opened this issue Feb 18, 2013 · 1 comment

Comments

@andreineculau
Copy link
Member

Webmachine decision core and the resource callbacks (can) set headers almost anywhere, which easily leads to headers being set for HTTP status codes where they don't make sense, eg. https://github.com/basho/webmachine/issues/114

Proposed resolution
Mark possible headers as meta-data, and only set a subset of those as response headers at the end of the request processing flow ie. webmachine_decision_core:respond and finish_request resource callback. This would make respond and finish_request encapsulate logic around the HTTP status codes..

@andreineculau
Copy link
Member Author

solved in v4
headers are only set, if undefined (i.e. unless the resource set a header outside of the decision diagram = don't overwrite)
headers are set, or supposed to be set along the diagram. on last headers are stringified from the operation.response.h (header objects) to operation.response.headers(unless a header is defined already)

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

1 participant