Prevent error when `Accept` header is not sent.

If the client didn't send this header with a request, `accept`
will be undefined and checking the headers will throw an error
on all requests.
Merge pull request #1 from hughsk/safe-header-check

Prevent error when `Accept` header is not sent.