mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-27 01:29:55 +02:00
* Some small fixes after testing: avoid AV when SQL logging requested and no connection available. Allow CORS on customview
git-svn-id: trunk@41805 -
This commit is contained in:
parent
c763fbf84b
commit
d5a1e71c5e
@ -900,7 +900,10 @@ function TSQLDBRestDispatcher.CreateCustomViewResource: TSQLDBRestResource;
|
|||||||
begin
|
begin
|
||||||
Result:=TCustomViewResource.Create(Nil);
|
Result:=TCustomViewResource.Create(Nil);
|
||||||
Result.ResourceName:=FStrings.GetRestString(rpCustomViewResourceName);
|
Result.ResourceName:=FStrings.GetRestString(rpCustomViewResourceName);
|
||||||
Result.AllowedOperations:=[roGet];
|
if rdoHandleCORS in DispatchOptions then
|
||||||
|
Result.AllowedOperations:=[roGet,roOptions,roHead]
|
||||||
|
else
|
||||||
|
Result.AllowedOperations:=[roGet,roHead];
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TSQLDBRestDispatcher.CreateMetadataResource: TSQLDBRestResource;
|
function TSQLDBRestDispatcher.CreateMetadataResource: TSQLDBRestResource;
|
||||||
@ -1658,7 +1661,7 @@ begin
|
|||||||
DoLog(rloConnection,IO,'Using connection to Host: %s; Database: %s',[Conn.HostName,Conn.DatabaseName])
|
DoLog(rloConnection,IO,'Using connection to Host: %s; Database: %s',[Conn.HostName,Conn.DatabaseName])
|
||||||
else
|
else
|
||||||
DoLog(rloConnection,IO,'Resource %s does not require connection',[IO.ResourceName]);
|
DoLog(rloConnection,IO,'Resource %s does not require connection',[IO.ResourceName]);
|
||||||
if MustLog(rloSQL) then
|
if assigned(Conn) and MustLog(rloSQL) then
|
||||||
begin
|
begin
|
||||||
Conn.LogEvents:=LogSQLOptions;
|
Conn.LogEvents:=LogSQLOptions;
|
||||||
Conn.OnLog:=@IO.DoSQLLog;
|
Conn.OnLog:=@IO.DoSQLLog;
|
||||||
|
Loading…
Reference in New Issue
Block a user