Behatch / contexts

Behat extension with most custom helper steps
Other
394 stars 203 forks source link

fix: don't set the Accept header by default #293

Open dunglas opened 3 years ago

dunglas commented 3 years ago

This is a workaround for https://github.com/symfony/symfony/issues/33393.

Currently, because of a limitation in Symfony, a default Accept HTTP header is always set to text/html. This is annoying when testing an API: it's a legit testing use case to ensure that the API behaves properly if this header isn't passed. Until recently, it was possible to use a hack to remove this header (for instance, in API Platform: https://github.com/api-platform/core/blob/master/features/bootstrap/HttpHeaderContext.php#L32), but it doesn't work anymore because Symfony now enforces type parameters.