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

Implement failure only transforms #1300

Merged
merged 2 commits into from
Oct 19, 2021
Merged

Implement failure only transforms #1300

merged 2 commits into from
Oct 19, 2021

Conversation

Tratcher
Copy link
Member

Fixes #1256

Response transforms can be conditionally run on success or failure, as indicated by the response status code being greater or less than 400. Note if there is no proxy response then HttpForwarder set the response status code to 50x before running transforms.

@Tratcher Tratcher added this to the YARP RC1 milestone Oct 19, 2021
@Tratcher Tratcher self-assigned this Oct 19, 2021
Copy link
Member

@MihaZupan MihaZupan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there an example use case we could add to the transforms doc?
Afaik we don't have a StatusCode transform for something like #1256 (comment)

@Tratcher
Copy link
Member Author

The example wouldn't look any different than the ones already given in the docs.

{
  "ResponseHeader": "HeaderName",
  "Append": "value",
  "When": "Failure"
}

@Tratcher Tratcher merged commit d69342d into main Oct 19, 2021
@Tratcher Tratcher deleted the tratcher/failtransforms branch October 19, 2021 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Introduce "Failure" response transforms run mode
2 participants