Guest User

Untitled

a guest
Jun 19th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. if (isset($_SERVER['HTTP_ACCEPT'])) {
  2. // normalize things like "application/json; charset=utf-8" to application/json
  3. foreach ($acceptedContentTypes as $contentType) {
  4. if (strpos(strtolower($_SERVER['HTTP_ACCEPT']), $contentType) !== false) {
  5. $_SERVER['HTTP_ACCEPT'] = $contentType;
  6. $this->setContentType($contentType);
  7. break;
  8. }
  9. }
  10. }
Add Comment
Please, Sign In to add comment