mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 17:29:10 +02:00
* 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:
parent
23a9a30bb7
commit
c6fafb7325
@ -1714,7 +1714,10 @@ begin
|
|||||||
Conn.OnLog:=@IO.DoSQLLog;
|
Conn.OnLog:=@IO.DoSQLLog;
|
||||||
end;
|
end;
|
||||||
if (rdoHandleCORS in DispatchOptions) then
|
if (rdoHandleCORS in DispatchOptions) then
|
||||||
|
begin
|
||||||
IO.Response.SetCustomHeader('Access-Control-Allow-Origin',ResolvedCORSAllowedOrigins(IO.Request));
|
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
|
if not AuthenticateRequest(IO,True) then
|
||||||
exit;
|
exit;
|
||||||
if Not CheckResourceAccess(IO) then
|
if Not CheckResourceAccess(IO) then
|
||||||
@ -2008,7 +2011,7 @@ begin
|
|||||||
IO.RestOutput.InitStreaming;
|
IO.RestOutput.InitStreaming;
|
||||||
IO.RestInput.InitStreaming;
|
IO.RestInput.InitStreaming;
|
||||||
IO.OnSQLLog:=@Self.DoSQLLog;
|
IO.OnSQLLog:=@Self.DoSQLLog;
|
||||||
if AuthenticateRequest(IO,False) then
|
if SameText('OPTIONS',aRequest.Method) or AuthenticateRequest(IO,False) then
|
||||||
DoHandleRequest(IO)
|
DoHandleRequest(IO)
|
||||||
except
|
except
|
||||||
On E : Exception do
|
On E : Exception do
|
||||||
|
Loading…
Reference in New Issue
Block a user