mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-12 10:09:08 +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
|
||||
Result:=TCustomViewResource.Create(Nil);
|
||||
Result.ResourceName:=FStrings.GetRestString(rpCustomViewResourceName);
|
||||
Result.AllowedOperations:=[roGet];
|
||||
if rdoHandleCORS in DispatchOptions then
|
||||
Result.AllowedOperations:=[roGet,roOptions,roHead]
|
||||
else
|
||||
Result.AllowedOperations:=[roGet,roHead];
|
||||
end;
|
||||
|
||||
function TSQLDBRestDispatcher.CreateMetadataResource: TSQLDBRestResource;
|
||||
@ -1658,7 +1661,7 @@ begin
|
||||
DoLog(rloConnection,IO,'Using connection to Host: %s; Database: %s',[Conn.HostName,Conn.DatabaseName])
|
||||
else
|
||||
DoLog(rloConnection,IO,'Resource %s does not require connection',[IO.ResourceName]);
|
||||
if MustLog(rloSQL) then
|
||||
if assigned(Conn) and MustLog(rloSQL) then
|
||||
begin
|
||||
Conn.LogEvents:=LogSQLOptions;
|
||||
Conn.OnLog:=@IO.DoSQLLog;
|
||||
|
Loading…
Reference in New Issue
Block a user