XRootD
Loading...
Searching...
No Matches
XrdHttpCors Class Referenceabstract

#include <XrdHttpCors.hh>

+ Inheritance diagram for XrdHttpCors:
+ Collaboration diagram for XrdHttpCors:

Public Member Functions

virtual void addAllowedOrigin (const std::string &origin)=0
 
virtual int Configure (const char *configFN, XrdSysError *errP)=0
 
virtual std::optional< std::string > getCORSAllowOriginHeader (const std::string &origin)=0
 

Detailed Description

Base class for CORS plugin implementation

Definition at line 38 of file XrdHttpCors.hh.

Member Function Documentation

◆ addAllowedOrigin()

virtual void XrdHttpCors::addAllowedOrigin ( const std::string & origin)
pure virtual

Add trusted origins to the CORS plugin

Parameters
originthe trusted origin to add

Implemented in XrdHttpCorsHandler.

◆ Configure()

virtual int XrdHttpCors::Configure ( const char * configFN,
XrdSysError * errP )
pure virtual

Configure the CORS plugin

Parameters
configFNthe server configuration file path
errPthe pointer to the error object
Returns
0 if the configuration is successful, 1 otherwise

Implemented in XrdHttpCorsHandler.

◆ getCORSAllowOriginHeader()

virtual std::optional< std::string > XrdHttpCors::getCORSAllowOriginHeader ( const std::string & origin)
pure virtual

Returns the fully formed Access-Control-Allow-Origin header. If the origin passed in parameter matches one of the previously added origins, it will return "Access-Control-Allow-Origin: matchedOrigin". If the origin passed in parameter does not match any of the previously added origins, then std::nullopt will be returned

Parameters
origin
Returns
either the fully formed Access-Control-Allow-Origin header or nullopt if the origin does not match any added origin

Implemented in XrdHttpCorsHandler.


The documentation for this class was generated from the following file: