Skip to content
This repository has been archived by the owner on Jan 28, 2024. It is now read-only.

Commit

Permalink
fix(server): stop routes from accepting default text/plain requests (
Browse files Browse the repository at this point in the history
…#733)

* fix(server): stop routes from accepting default `text/plain` requests

* chore(server): update comment
  • Loading branch information
Fdawgs committed May 23, 2023
1 parent 224d7e3 commit da4f492
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ const sharedSchemas = require("./plugins/shared-schemas");
* @param {object} config - Fastify configuration values.
*/
async function plugin(server, config) {
/**
* Stop routes from accepting 'text/plain' POST/PUT/PATCH
* requests by removing included default parser
*/
await server.removeContentTypeParser("text/plain");

// Register plugins
await server
// Accept header handler
Expand Down

0 comments on commit da4f492

Please sign in to comment.