Skip to content

Commit aea70f6

Browse files
committed
Merged revision(s) 3079 from SourceForge:
Correção geral no Webpascal ServerContext e ContextRules(em Teste).
1 parent 6c482b8 commit aea70f6

3 files changed

Lines changed: 14 additions & 9 deletions

File tree

CORE/Source/Basic/uRESTDWBasic.pas

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2078,6 +2078,7 @@ interface
20782078
End;
20792079
If RESTDWFileExists(sFile, FRootPath) then
20802080
Begin
2081+
StatusCode := 200;
20812082
ContentType := GetMIMEType(sFile);
20822083
ServerContextStream := TMemoryStream.Create;
20832084
ServerContextStream.LoadFromFile(sFile);
@@ -3828,15 +3829,15 @@ interface
38283829
LocalDoc := '';
38293830
If TEncodeSelect(vEncoding) = esUtf8 Then
38303831
sCharset := 'utf-8'
3831-
Else If TEncodeSelect(vEncoding) in [esANSI, esASCII] Then
3832+
Else If TEncodeSelect(vEncoding) in [esANSI, esASCII] Then
38323833
sCharset := 'ansi';
38333834
If Not vSpecialServer Then
38343835
Begin
38353836
StatusCode := vErrorCode;
38363837
If ServerContextStream <> Nil Then
38373838
Begin
38383839
If Not (Assigned(ResultStream)) Then
3839-
ResultStream := TStringStream.Create(''); //Anderson
3840+
ResultStream := TStringStream.Create('');
38403841
WriteStream(ServerContextStream, ResultStream);
38413842
FreeAndNil(ServerContextStream);
38423843
End
@@ -3854,6 +3855,8 @@ interface
38543855
{$IF CompilerVersion > 21}
38553856
mb := TStringStream.Create(JSONStr{$IFNDEF FPC}{$IF CompilerVersion > 21}, TEncoding.UTF8{$IFEND}{$ENDIF});
38563857
mb.Position := 0;
3858+
If Not (Assigned(ResultStream)) Then
3859+
ResultStream := TStringStream.Create('');
38573860
WriteStream(mb, ResultStream);
38583861
FreeAndNil(mb);
38593862
{$ELSE}
@@ -6387,12 +6390,14 @@ interface
63876390
vTagService := False;
63886391
For B := 0 To TRESTDWServerContext(ServerMethodsClass.Components[i]).ContextList.Count -1 Do
63896392
Begin
6390-
If ((LowerCase(urlContext) = LowerCase(TRESTDWServerContext(ServerMethodsClass.Components[i]).DefaultContext))) Or
6391-
((Trim(TRESTDWServerContext(ServerMethodsClass.Components[i]).DefaultContext) = '') And (Pooler = '') And
6392-
(TRESTDWServerContext(ServerMethodsClass.Components[i]).ContextList.ContextByName[urlContext] <> Nil)) Then
6393+
If ((LowerCase(Pooler) = LowerCase(TRESTDWServerContext(ServerMethodsClass.Components[i]).DefaultContext))) Or
6394+
((Trim(TRESTDWServerContext(ServerMethodsClass.Components[i]).DefaultContext) = '') And
6395+
((urlContext = '') or (urlContext = '/'))) Then
6396+
vTagService := (TRESTDWServerContext(ServerMethodsClass.Components[i]).ContextList.ContextByName[Pooler] <> Nil);
6397+
If vTagService Then
63936398
Begin
63946399
vRootContext := TRESTDWServerContext(ServerMethodsClass.Components[i]).DefaultContext;
6395-
If ((Pooler = '') And (vRootContext <> '')) Then
6400+
If (((urlContext = '') or (urlContext = '/')) And (vRootContext <> '')) And (Pooler = '') Then
63966401
Pooler := vRootContext;
63976402
End
63986403
Else

CORE/Source/Consts/uRESTDWConsts.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
monthnames : Array [1 .. 12] Of string = ('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', {do not localize}
7272
'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'); {do not localize}
7373
RESTDWVersionINFO = 'v2.0.2-';
74-
RESTDWRelease = '3076';
74+
RESTDWRelease = '3079';
7575
RESTDWCodeProject = 'Savage Reign - GitHub';
7676
RESTDWVersao = RESTDWVersionINFO + RESTDWRelease + '(' + RESTDWCodeProject + ')';
7777
GOffsetFromUTC : TDateTime = 0{$IFDEF HAS_DEPRECATED}deprecated{$ENDIF};

CORE/Source/Wizards/STLWizard.pas

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1047,7 +1047,7 @@ function Tstlapplicationwizard.GetFrameworkTypes: TArray<string>;
10471047
{ Return the platform keys for the platforms this wizard supports }
10481048
function Tstlapplicationwizard.GetPlatforms: TArray<string>;
10491049
begin
1050-
SetLength(Result, 8);
1050+
SetLength(Result, 3);
10511051
Result[0] := cWin32Platform;
10521052
Result[1] := cWin64Platform;
10531053
Result[2] := cLinux64Platform;
@@ -1062,7 +1062,7 @@ function Tstlapplicationwizard.GetPlatforms: TArray<string>;
10621062
{$IF COMPILERVERSION > 31}
10631063
function Tstlapplicationwizard.GetSupportedPlatforms: TArray<string>;
10641064
begin
1065-
SetLength(Result, 8);
1065+
SetLength(Result, 6);
10661066
Result[0] := cWin32Platform;
10671067
Result[1] := cWin64Platform;
10681068
Result[2] := cLinux64Platform;

0 commit comments

Comments
 (0)