always return set payload body for error codes#27
Open
james-bowers wants to merge 1 commit intomasterfrom
Open
always return set payload body for error codes#27james-bowers wants to merge 1 commit intomasterfrom
james-bowers wants to merge 1 commit intomasterfrom
Conversation
ettomatic
reviewed
Jul 3, 2020
| {406, "/*"} -> {:ok, OriginSimulator.recipe_not_set()} | ||
| {406, _} -> {:ok, OriginSimulator.recipe_not_set(path)} | ||
| _ -> {:ok, "Error #{status}"} | ||
| _ -> cache_lookup(route) |
Collaborator
There was a problem hiding this comment.
Sorry maybe I'm missing the reasoning for this. I'm not sure why it's trying to fetch from cache for 404s
Collaborator
There was a problem hiding this comment.
ah it's probably the discussion in Slack. It'd be useful to add a line in the PR desc
boonious
reviewed
Jul 3, 2020
Contributor
boonious
left a comment
There was a problem hiding this comment.
This does mean that scenarios such as this one in README, would return 200 origin payload for the specified statuses: https://github.com/bbc/origin_simulator#scenarios .
boonious
approved these changes
Jul 3, 2020
Contributor
boonious
left a comment
There was a problem hiding this comment.
An improvement to be able to set 404/500 body in single-stage recipes (vs. same payload in multi-stages-statues recipes which could be emulated by updating OS recipe during test).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We don't want to overwrite the provided response body when a recipe returns anything other than a 200.