Skip to content

Commit 41baeb1

Browse files
committed
Fix Accept header parsing RegEx and docs
1 parent 8f03783 commit 41baeb1

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/api/resources/proxy/client/Client.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,9 @@ export class Proxy {
2323

2424
/**
2525
* Precompiled regex to check if an Accept header accepts JSON responses.
26-
* Matches: application/json, */*, or application/* (with or without parameters)
26+
* Matches: application/json (with or without parameters)
2727
*/
28-
private static readonly JSON_ACCEPT_REGEX =
29-
/(?:^|,|\s)(application\/json|\*\/\*|application\/\*)(?:\s*;|\s*,|\s*$)/i;
28+
private static readonly JSON_ACCEPT_REGEX = /(?:^|,|\s)application\/json(?:\s*;|\s*,|\s*$)/i;
3029

3130
/**
3231
* Precompiled regex to check if a Content-Type header is JSON.

0 commit comments

Comments
 (0)