blob: 1cd85647042cefee263b179833a2ae4714a7adcb [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{
Ed Tanousb00dcc22021-02-23 12:52:50 -08009inline void requestRoutes(App& app)
Ed Tanous52cc1122020-07-18 13:51:21 -070010{
11 BMCWEB_ROUTE(app, "<str>")
12 .methods(boost::beast::http::verb::options)(
zhanghch058d1b46d2021-04-01 11:18:24 +080013 [](const crow::Request&, const std::shared_ptr<bmcweb::AsyncResp>&,
14 const std::string&) {
Ed Tanous52cc1122020-07-18 13:51:21 -070015 // An empty body handler that simply returns the headers bmcweb
16 // uses This allows browsers to do their CORS preflight checks
Ed Tanous52cc1122020-07-18 13:51:21 -070017 });
18}
19} // namespace cors_preflight