blob: b7272229b185eef02f2c3dc40c4c77ad5c975866 [file] [log] [blame]
Ed Tanous52cc1122020-07-18 13:51:21 -07001#pragma once
2
Ed Tanous3ccb3ad2023-01-13 17:40:03 -08003#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)(
Ed Tanous104f09c2022-01-25 09:56:04 -080013 [](const crow::Request& /*req*/,
14 const std::shared_ptr<bmcweb::AsyncResp>&, const std::string&) {
Ed Tanous002d39b2022-05-31 08:59:27 -070015 // An empty body handler that simply returns the headers bmcweb
16 // uses This allows browsers to do their CORS preflight checks
Patrick Williams5a39f772023-10-20 11:20:21 -050017 });
Ed Tanous52cc1122020-07-18 13:51:21 -070018}
19} // namespace cors_preflight