SAP / ui5-tooling

An open and modular toolchain to develop state of the art applications based on the UI5 framework
https://sap.github.io/ui5-tooling
Apache License 2.0
465 stars 69 forks source link

ui5 serve doesn't pass all url parameters #195

Closed lboehm closed 4 years ago

lboehm commented 4 years ago

Expected Behavior

I expect the UI5 tooling to call the URL for ui5 serve as it is provided.

Current Behavior

UI5 serve just passes the first url parameter. All other URL parameters are dismissed.

Steps to reproduce the issue

  1. Add multiple URL parameters to your serve task (e.g. ui5 serve -o index.html?sap-theme=sap_fiori_3&sap-language=DE)
  2. Run your task
  3. => Only the first URL parameter gets passed to the browser:
    • the URL which will be opened is http://localhost:8080/index.html?sap-theme=sap_fiori_3
    • the second parameter (sap-language=DE) is ignored

Context

Affected components (if known)

codeworrior commented 4 years ago

That's most likely not an issue of the UI5 tooling. The '&' character is special for most shells and joins the execution of two commands. You just have to add quotes around the whole parameter to prevent this. Check the documentation for your shell to learn about the '&' and the potential differences between single and double quotes.

ui5 serve -o "index.html?sap-theme=sap_fiori_3&sap-language=de"

What happens without quotes, is that your shell splits the command line into two commands at the '&' character and executes both commands in sequence. What the ui5 command receives is just

ui5 serve -o index.html?sap-theme=sap_fiori_3

When this command succeeds, the shell will execute the second command

sap-language=DE

As the command line is split by the shell before ui5 is invoked, this is nothing that we could address.

lboehm commented 4 years ago

You're right! Thanks for the quick response.