Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (isset($_SERVER['HTTP_ACCEPT'])) {
- // normalize things like "application/json; charset=utf-8" to application/json
- foreach ($acceptedContentTypes as $contentType) {
- if (strpos(strtolower($_SERVER['HTTP_ACCEPT']), $contentType) !== false) {
- $_SERVER['HTTP_ACCEPT'] = $contentType;
- $this->setContentType($contentType);
- break;
- }
- }
- }
Add Comment
Please, Sign In to add comment