mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-16 17:19:32 +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;
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user