lemaiwo / ui5-middleware-route-proxy

UI5Tooling route proxy
MIT License
11 stars 4 forks source link

Proxy tries redirecting for index.html if service located on default_host in SAP #18

Open ButzT opened 1 year ago

ButzT commented 1 year ago

Hi there!

I think there is an bug when I've got an _service located on default_host_ in SAP - means top level in sicf. I change the standard path for the proxy from /sap/opu/odata/sap/ to only / (which would be how I access the service directly in browser) in the ui5.yaml then the proxy tries to redirect even for index.html to the sap system, where of course nothing is found.

If I change the path to /sap/ or something else it does not redirect for index.html but just correctly opens it from the directory, so I can see and test the app - but of course it does not find my service when I do an service call.

ui5.yaml:

server:
  customMiddleware:
    - name: ui5-middleware-route-proxy
      afterMiddleware: compression
      configuration:
        debug: true
        **/:**
          target: http://dbehd1.de.xxxxx.intra:8030
          auth: ....

Terminal: image

Error in browser: image

Accessing service in browser: http://dbehd1.de.xxxxx.intra:8030/ZEMPTY_PAL_SRV?huident=123456789876543&lgnum=2630

lemaiwo commented 1 year ago

Have you tried using the service as path like this "/ZEMPTY_PAL_SRV"?

In my opinion it makes sense that it forwards everything to the backend when you only provide "/" as the path. It's a feature not a bug :)