-
Notifications
You must be signed in to change notification settings - Fork 395
Open
Description
Description of the problem:
Currently the library checks the response Content-Type too strictly:
if ($this->getResponseContentType() === 'application/jwt') {
// ...
}However, some servers return a Content-Type with additional parameters, for example:
Content-Type: application/jwt; charset=utf-8
Proposed Solution
Relax the check so that it accepts Content-Types starting with application/jwt:
if (strpos($this->getResponseContentType(), 'application/jwt') === 0) {
// ...
}This will correctly match both application/jwt and application/jwt; charset=utf-8.
See PR : #493
Technical notes
- We considered using
str_containsfor readability, but since the library still supports PHP 7, we chosestrposfor compatibility. - If/when PHP 7 support is dropped, the condition could be updated to
str_containsfor clarity.
Metadata
Metadata
Assignees
Labels
No labels