I'm working on a inventory web app here and I'm trying to gather some basic
information about registered hosts to foreman using the API.
Browsers preflight ajax requests to different domains with an OPTIONS
"the specification mandates that browsers "preflight" the request,
soliciting supported methods from the server with an HTTP OPTIONS request
method, and then, upon "approval" from the server, sending the actual
request with the actual HTTP request method."
This isn't working with foreman, the OPTIONS request returns a 404. Here's
the snippet from production.log
Started OPTIONS "/api/v2/hosts" for x.x.x.x at 2014-12-24 08:45:06 +0100
ActionController::RoutingError (No route matches [OPTIONS] "/api/v2/hosts"):
`block (3 levels) in start_threads'
We have added these options to apache but this doesn't help.
I guess it's because everything goes to foreman / passenger anyway…
Header set Access-Control-Allow-Origin "*" Header set Access-Control-Allow-Methods: "GET, POST, PUT, DELETE,
We're running foreman 1.6.2.
Any help would be appreciated.