cancel
Showing results for 
Search instead for 
Did you mean: 

CAP CDS (node.js) url rewrites

carlonnheim
Participant
539

Hi,

I am having an issue with a CAP CDS (node.js) application where the server redirects the urls. It seems the standard server is picking up any url part which leads with the service name and directs it straight to the service.

I have a service named "something", and entity in it which is named "somecontainer" which has an association named "somethingImportant" for example, I want to be able to do this:

https://.../something/somecontainer('abc')/somethingImportant

But when I do that, the server response with a 308-redirect to /somethingImportant (which does not exist).

I can trace it to coming from here and that the "lastIndexOf" search is looking for the service name without a closing "/" (so the attempted service url of "/something" matches with the navigation "/somethingImportant"), but I cannot see how to avoid it?

Thanks in advance!

//Carl

chgeo
Advisor
Advisor

Thanks for analysing this. Seems like an unfortunate side effect of the redirect. Will check.

In the meanwhile you can disable this feature using {cds: { features: { fiori_routes:false } } } in package.json

Accepted Solutions (1)

Accepted Solutions (1)

chgeo
Advisor
Advisor
0 Kudos

This is fixed with @sap/cds 5.8.0.

carlonnheim
Participant
0 Kudos

Perfect, thanks Christian!

Answers (0)