blob: 3311ea9fe2b5eca3dd0dff218914ceab66daf604 [file]
#ifndef THIRD_PARTY_GBMCWEB_INCLUDE_CORS_PREFLIGHT_H_
#define THIRD_PARTY_GBMCWEB_INCLUDE_CORS_PREFLIGHT_H_
#include <memory>
#include <string>
#include "app.hpp"
#include "http_request.hpp"
#include "async_resp.hpp"
namespace cors_preflight {
inline void requestRoutes(App& app) {
BMCWEB_ROUTE(app, "<str>")
.methods(boost::beast::http::verb::options)(
[](const crow::Request& /*req*/,
const std::shared_ptr<bmcweb::AsyncResp>&, const std::string&) {
// An empty body handler that simply returns the headers bmcweb
// uses This allows browsers to do their CORS preflight checks
});
}
} // namespace cors_preflight
#endif // THIRD_PARTY_GBMCWEB_INCLUDE_CORS_PREFLIGHT_H_