Closed daselang closed 12 months ago
Perhaps you could easily circumvent all this using the routing renaming at HTTP server level. https://blog.synopse.info/?post/2022/12/25/Efficient-Routing-for-Christmas
Please use HTTP routing for this.
Reopen if it is not enough.
1. inherit
TMVCApplication
and implementStart
with code:fMainRunner := TMvcRunOnRestServer.Create(Self, nil, 'bb', aViews);
index
is theaRoot
,bb
is the value of param namedaSubURI
, so it will go throughRunOnRestServerSub
,so visiting/index/bb
will triggerCtxt.Redirect(Ctxt.UriWithoutSignature + '/default')
, but the brower redirects to/index/index/bb/default
,and caused400 Bad Reqeuest
I think it should be/index/bb/default
as the right url.2.if set
/bb
as theaSubURI
,mORMot2 will not make it as a validMethodName
inServiceMethodRegister
,actually mappingbb
to the same method name underTMVCApplication
.3.set
bb/
as as theaSubURI
.it works. but visiting/index/bb
will not trigger any redirect inRunOnRestServerSub
for it is mapped to method underTMVCApplication
,only/index/bb/
works to trigger the redirection.2 && 3, I think ,for normal user's perspective,both
/index/bb
and/index/bb/
without any more subUrls append,should be the same action.I think some optimizations should be updated to handle with the/
in brower url andaSubURI
,you can forbidden or delete the/
in head and tail of theaSubURI
when resgisting the service. and regard/index/bb/
as same as/index/bb
,for users always copy the url and send to others but forget coppying the last/
.Maybe in mORMot1,it will be the same action,fix both if you think it is an issue.