mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-11 09:26:15 +02:00
+ Fixed bug #7133: invalid URL should give an error
git-svn-id: trunk@4420 -
This commit is contained in:
parent
43d73cca57
commit
d48866d4e2
@ -426,7 +426,7 @@ end;
|
|||||||
|
|
||||||
procedure THttpServerConnection.RequestStreamReceived;
|
procedure THttpServerConnection.RequestStreamReceived;
|
||||||
var
|
var
|
||||||
i: Integer;
|
i : Integer;
|
||||||
s, URI: String;
|
s, URI: String;
|
||||||
Servlet: TGenericServlet;
|
Servlet: TGenericServlet;
|
||||||
Request: THttpServletRequest;
|
Request: THttpServletRequest;
|
||||||
@ -435,18 +435,16 @@ begin
|
|||||||
// WriteLn('Stream received: ', RequestStream.Size, ' bytes');
|
// WriteLn('Stream received: ', RequestStream.Size, ' bytes');
|
||||||
|
|
||||||
URI := UpperCase(RequestHeader.URI);
|
URI := UpperCase(RequestHeader.URI);
|
||||||
for i := 0 to Server.ServletMappings.Count - 1 do
|
I:=0;
|
||||||
begin
|
Servlet:=Nil;
|
||||||
|
While (Servlet=Nil) and (I<Server.ServletMappings.Count) do
|
||||||
|
begin
|
||||||
s := UpperCase(Server.ServletMappings[i].URLPattern);
|
s := UpperCase(Server.ServletMappings[i].URLPattern);
|
||||||
if ((s[Length(s)] = '*') and (Copy(s, 1, Length(s) - 1) =
|
if ((s[Length(s)] = '*') and (Copy(s, 1, Length(s) - 1) =
|
||||||
Copy(URI, 1, Length(s) - 1))) or (s = URI) then
|
Copy(URI, 1, Length(s) - 1))) or (s = URI) then
|
||||||
break;
|
Servlet:=Server.ServletMappings[i].Servlet;
|
||||||
end;
|
inc(I);
|
||||||
|
end;
|
||||||
if i < Server.ServletMappings.Count then
|
|
||||||
Servlet := Server.ServletMappings[i].Servlet
|
|
||||||
else
|
|
||||||
Servlet := nil;
|
|
||||||
|
|
||||||
if RequestHeader.ContentLength = 0 then
|
if RequestHeader.ContentLength = 0 then
|
||||||
RequestHeader.ContentLength := RequestStream.Size;
|
RequestHeader.ContentLength := RequestStream.Size;
|
||||||
|
Loading…
Reference in New Issue
Block a user