Ed Tanous | 52cc112 | 2020-07-18 13:51:21 -0700 | [diff] [blame^] | 1 | #pragma once |
| 2 | |
| 3 | #include <app.h> |
| 4 | #include <http_request.h> |
| 5 | #include <http_response.h> |
| 6 | |
| 7 | namespace cors_preflight |
| 8 | { |
| 9 | void requestRoutes(App& app) |
| 10 | { |
| 11 | BMCWEB_ROUTE(app, "<str>") |
| 12 | .methods(boost::beast::http::verb::options)( |
| 13 | [](const crow::Request& req, crow::Response& res) { |
| 14 | // An empty body handler that simply returns the headers bmcweb |
| 15 | // uses This allows browsers to do their CORS preflight checks |
| 16 | res.end(); |
| 17 | }); |
| 18 | } |
| 19 | } // namespace cors_preflight |