#1 2023-01-31 20:58:22

itSDS
Member
From: Germany
Registered: 2014-04-24
Posts: 506

Error parsing .static files

Hi Arnaud, you modified TMvcRunOnRestServer.InternalRunOnRestServer
and now my Methodname '.static/js/chunk-vendors.51b2b211.js'
does not work any more depending on:

  p := pointer(MethodName);
  if GetNextItemMultiple(p, '/?', rawMethodName) = '/' then
    GetNextItemMultiple(p, '/?', rawFormat);

Get error 404 - File not found. Mormot is not looking for "js/chunk-vendors.51b2b211.js" it looks for "js"

I have subfolder's in the .static folder !

in V2.0.4496 the Methodname works as expected with:

  Split(MethodName, '/', rawMethodName, rawFormat);

As Workaround i removed the new code an replaced it with the old one.


Rad Studio 12.1 Santorini

Offline

#2 2023-02-01 00:47:00

PierceNg
Member
From: Singapore
Registered: 2023-01-29
Posts: 9
Website

Re: Error parsing .static files

mORMot newbie here, just started exploring the code base. I ran into this yesterday and thought it was intended behaviour. Ended up writing a simple method-based service to serve static content that runs together with the MVC app.

Offline

#3 2023-02-01 08:13:20

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,232
Website

Re: Error parsing .static files

Using Split() as you did would not work with URI encoded parameters like ?a=xxx&b=yyy

Please try https://github.com/synopse/mORMot2/commit/e52dca77

Offline

#4 2023-02-01 09:14:49

PierceNg
Member
From: Singapore
Registered: 2023-01-29
Posts: 9
Website

Re: Error parsing .static files

Thank you. Tested ok.

Offline

#5 2023-02-01 19:26:52

itSDS
Member
From: Germany
Registered: 2014-04-24
Posts: 506

Re: Error parsing .static files

yes works


Rad Studio 12.1 Santorini

Offline

Board footer

Powered by FluxBB