Skip to content

TCORSSupport

Cross-Origin Resource Sharing support

Declaration

Source position: httpdefs.pp line 749

type

  TCORSSupport = class(TPersistent)
  public
    constructor Create;
    function ResolvedCORSAllowedOrigins : string;
    function HandleRequest : Boolean;
    procedure Assign;
  published
    property Enabled: Boolean; {rw}
    property Options: TCORSOptions; {rw}
    property AllowedMethods: string; {rw}
    property AllowedOrigins: string; {rw}
    property AllowedHeaders: string; {rw}
    property MaxAge: Integer; {rw}
  end;

Description

TCORSSupport provides functionality for handling CORS (Cross-Origin Resource Sharing) requests. It manages allowed origins, methods, headers, and other CORS-related settings.

Properties

Member Visibility Description
AllowedHeaders published Headers allowed for CORS requests
AllowedMethods published HTTP methods allowed for CORS requests
AllowedOrigins published Origins allowed for CORS requests
Enabled published Enables or disables CORS support
MaxAge published Maximum age for CORS preflight cache in seconds
Options published CORS configuration options
See all Properties

Methods

Member Visibility Description
Assign public Assigns CORS settings from another object
Create public Creates a new CORS support instance
HandleRequest public Handles CORS request processing
ResolvedCORSAllowedOrigins public Resolves allowed origins for CORS requests
See all Methods

See also

Name Description
TCORSOptions Set of CORS options
THandleCORSOptions Set of CORS handling options