ecyrbe/zodios

Config: option to disable checking the "content-type" response header

Closed this issue · 1 comments

I have had several situations where the external api developer does not add the content-type: application/json header to the response.
In this case the code from the file src/plugins/zod-validation.plugin.ts line 97 will not attempt to validate the data according to the schema. In this case it appears to the external code that the request has completed successfully, while no validation or transformation has been applied to the response, resulting in runtime errors.

I see this as a problem and would like to add a setting to ignore the content-type header validation for the client as a whole or for individual endpoints.
Should I make a pull request with the fix or would you like to add this yourself?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.