Fixes a bug causing HTTP 405 for all requests

Fixes a bug of improper handling of CORS OPTIONS requests resulting in
HTTP 405.