blob: 844fd3862eab4dc84357f63b7938d596987fa259 [file] [log] [blame]
Ed Tanous52cc1122020-07-18 13:51:21 -07001#pragma once
2
Ed Tanous04e438c2020-10-03 08:06:26 -07003#include <app.hpp>
4#include <http_request.hpp>
5#include <http_response.hpp>
Ed Tanous52cc1122020-07-18 13:51:21 -07006
7namespace cors_preflight
8{
9void requestRoutes(App& app)
10{
11 BMCWEB_ROUTE(app, "<str>")
12 .methods(boost::beast::http::verb::options)(
Ed Tanous0260d9d2021-02-07 19:31:07 +000013 [](const crow::Request&, crow::Response& res, const std::string&) {
Ed Tanous52cc1122020-07-18 13:51:21 -070014 // 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