mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-05-12 12:40:53 +00:00
[php-symfony] Never return 406 when user accepts */*
When a query has header "Accept" set to "*/*" it means it accepts everything. It is hence weird to return a 406. This patch ensures it does not occur: when the query accepts everything then we take any produced type. This fixes #13334. This also partly makes the open PR #15560 obsolete (or at least, it provides a workaround)
This commit is contained in:
parent
d6c4634269
commit
7b7c15ce6c
@ -204,6 +204,10 @@ class Controller extends AbstractController
|
||||
return 'application/xml';
|
||||
}
|
||||
|
||||
if (in_array('*/*', $accept)) {
|
||||
return $produced[0];
|
||||
}
|
||||
|
||||
// If we reach this point, we don't have a common ground between server and client
|
||||
return null;
|
||||
}
|
||||
|
@ -214,6 +214,10 @@ class Controller extends AbstractController
|
||||
return 'application/xml';
|
||||
}
|
||||
|
||||
if (in_array('*/*', $accept)) {
|
||||
return $produced[0];
|
||||
}
|
||||
|
||||
// If we reach this point, we don't have a common ground between server and client
|
||||
return null;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user