Skip to content

fix: trigger media type validation only when defined in the response#777

Merged
XVincentX merged 6 commits intomasterfrom
fix/mediaType-validation
Nov 7, 2019
Merged

fix: trigger media type validation only when defined in the response#777
XVincentX merged 6 commits intomasterfrom
fix/mediaType-validation

Conversation

@XVincentX
Copy link
Copy Markdown
Contributor

@XVincentX XVincentX commented Nov 6, 2019

Closes #774

  • Calls the media type return validator only if the selected response has contents with a media type
  • Uses now typeIs.is function library so that we can match stuff with charset headers as well instead of a simple equality check

@XVincentX XVincentX force-pushed the fix/mediaType-validation branch from 163027f to caf250a Compare November 6, 2019 18:37
@XVincentX XVincentX marked this pull request as ready for review November 6, 2019 18:38
@XVincentX XVincentX force-pushed the fix/mediaType-validation branch from caf250a to f32fadd Compare November 6, 2019 18:44
Copy link
Copy Markdown
Contributor

@karol-maciaszek karol-maciaszek left a comment

Choose a reason for hiding this comment

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

Error message improvement, rest is 👍

@XVincentX XVincentX merged commit 68b8ac1 into master Nov 7, 2019
@XVincentX XVincentX deleted the fix/mediaType-validation branch November 7, 2019 13:53
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.

Do not validate the output media type if the document does not specify any content

2 participants