You are not logged in.
Pages: 1
Why did you put all favicon things in unit mormot.rest.http.server and not in unit mormot.net.server. This unit contains e.g. PrivKeyCertPfx. The favicon actually has nothing to do with REST. In my third-party demo MustacheEditor only with HttpServer it would be welcome too. Then you would not have to write the following in function DoReject:
procedure THttpAsyncConnection.DoReject(status: integer);
...
if (fHttp.CommandUri <> '/favicon.ico') and
fServer.Async.Banned.BanIP(fRemoteIP4) then
...but write this:
if not UrlFavicon(Pointer(fHttp.CommandUri)) and
fServer.Async.Banned.BanIP(fRemoteIP4) then
Shouldn't the function be better named UrlPathFavicon(), because that's what's being checked?
Sorry if I am too inquisitive.
With best regards
Thomas
Offline
You can easily serve /favicon.ico in the HTTP server, but it was not easy with the REST server, which use TOrmModel.Root for its URI checks, and /favicon.ico is at the / level with no /root/.
Therefore it is only in the REST server.
UrFavicon() is a low-level function which could indeed be moved and used in DoReject().
It is a work in progress.
But an URL is already a path, isn't it?
Online
But an URL is already a path, isn't it?
When I write in English, I struggle with every word. My intuition says UrlPathFavicon(), but you are right.
Have a nice weekend.
With best regards
Thomas
Offline
Please check https://github.com/synopse/mORMot2/commit/9dd49267
Online
Pages: 1