THttpServlet servlet mappings strange behaviour

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

THttpServlet servlet mappings strange behaviour

Leonardo Cecchi
Hi,

I'm coding a small http application using che THttpServer class from the
FCL.
My application has only two servlet:

HttpServer.AddServlet(PrimoServlet, ´/primo´);
HttpServer.AddServlet(SecondoServlet, ´/secondo´);

It's all ok but I have some strange mappings between URI and servlets:

http://localhost:8080/blabla  -> Runs the second servlet
(SecondoServlet). Why?
http://localhost:8080        -> Runs the second servlet
(SecondoServlet). Why?
http://localhost:8080/primo  -> Runs the first servlet (OK)
http://localhost:8080/secondo -> Runs the second servlet (OK)

So an URI who is not present in the servlet mappings is mapped to the
last servlet instead of throwing an "Invalid URL".
It's a bug or a well-known behaviour?
Thanks,

Leonardo Cecchi

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal