* Merging revisions r44303 from trunk:

------------------------------------------------------------------------
    r44303 | michael | 2020-03-15 20:30:34 +0100 (Sun, 15 Mar 2020) | 1 line
    
    * Fixes in CORS handling
    ------------------------------------------------------------------------

git-svn-id: branches/fixes_3_2@46580 -
This commit is contained in:
michael 2020-08-23 09:16:55 +00:00
parent 23a9a30bb7
commit c6fafb7325

View File

@ -1714,7 +1714,10 @@ begin
Conn.OnLog:=@IO.DoSQLLog;
end;
if (rdoHandleCORS in DispatchOptions) then
begin
IO.Response.SetCustomHeader('Access-Control-Allow-Origin',ResolvedCORSAllowedOrigins(IO.Request));
IO.Response.SetCustomHeader('Access-Control-Allow-Credentials',BoolToStr(CORSAllowCredentials,'true','false'));
end;
if not AuthenticateRequest(IO,True) then
exit;
if Not CheckResourceAccess(IO) then
@ -2008,7 +2011,7 @@ begin
IO.RestOutput.InitStreaming;
IO.RestInput.InitStreaming;
IO.OnSQLLog:=@Self.DoSQLLog;
if AuthenticateRequest(IO,False) then
if SameText('OPTIONS',aRequest.Method) or AuthenticateRequest(IO,False) then
DoHandleRequest(IO)
except
On E : Exception do