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

Commit

Permalink
perf: use indexOf instead of includes
Browse files Browse the repository at this point in the history
  • Loading branch information
boywithkeyboard committed Jun 14, 2023
1 parent 4922867 commit aa662d3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Exception.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export class Exception {
const acceptHeader = request.headers.get('accept')

const json = acceptHeader
? acceptHeader.includes('application/json') || acceptHeader.includes('*/*')
? acceptHeader.indexOf('application/json') > -1 || acceptHeader.indexOf('*/*') > -1
: false

const body = json
Expand Down

0 comments on commit aa662d3

Please sign in to comment.