Skip to content

Commit

Permalink
Merge pull request #17 from Dakskihedron/missing-content-headers
Browse files Browse the repository at this point in the history
fix: set Content-Type header on 400 errors
  • Loading branch information
karlvr authored Apr 9, 2024
2 parents dc97b8c + 0bc4e2b commit 82a838f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/hungry-jars-scream.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@openapi-generator-plus/typescript-express-passport-server-generator": minor
---

Set Content-Type header on 400 errors.
1 change: 1 addition & 0 deletions templates/api.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ export default function(app: Express, impl: t.{{className name}}Api) {
} catch (error) {
/* Catch validation errors */
res.status(400)
res.type('text/plain; charset=utf-8')
res.send(error)
}
}
Expand Down

0 comments on commit 82a838f

Please sign in to comment.