XRootD
Loading...
Searching...
No Matches
XrdHttpCorsHandler.hh
Go to the documentation of this file.
1//------------------------------------------------------------------------------
2// This file is part of the XRootD framework
3//
4// Copyright (c) 2025 by European Organization for Nuclear Research (CERN)
5// Author: Cedric Caffy <cedric.caffy@cern.ch>
6// File Date: Jun 2025
7//------------------------------------------------------------------------------
8// XRootD is free software: you can redistribute it and/or modify
9// it under the terms of the GNU Lesser General Public License as published by
10// the Free Software Foundation, either version 3 of the License, or
11// (at your option) any later version.
12//
13// XRootD is distributed in the hope that it will be useful,
14// but WITHOUT ANY WARRANTY; without even the implied warranty of
15// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16// GNU General Public License for more details.
17//
18// You should have received a copy of the GNU Lesser General Public License
19// along with XRootD. If not, see <http://www.gnu.org/licenses/>.
20//------------------------------------------------------------------------------
21
22#ifndef __XROOTD_XRDHTTPCORSHANDLER_HH__
23#define __XROOTD_XRDHTTPCORSHANDLER_HH__
24
26#include <unordered_set>
27
32public:
33 XrdHttpCorsHandler() = default;
34 void addAllowedOrigin(const std::string & origin) override;
35 int Configure(const char * configFN, XrdSysError *errP) override;
36 std::optional<std::string> getCORSAllowOriginHeader(const std::string & origin) override;
37private:
38 std::unordered_set<std::string> m_origins;
39};
40
41
42#endif //__XROOTD_XRDHTTPCORSHANDLER_HH__
int Configure(const char *configFN, XrdSysError *errP) override
void addAllowedOrigin(const std::string &origin) override
XrdHttpCorsHandler()=default
std::optional< std::string > getCORSAllowOriginHeader(const std::string &origin) override