Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trailing slash after the HTML file name #178

Closed
whitphx opened this issue Aug 30, 2022 · 1 comment · Fixed by #179
Closed

Trailing slash after the HTML file name #178

whitphx opened this issue Aug 30, 2022 · 1 comment · Fixed by #179

Comments

@whitphx
Copy link
Owner

whitphx commented Aug 30, 2022

For example, when the mountable code is used in http://localhost:3000/test.html, the URL will be overwritten to http://localhost:3000/test.html/ on which the trailing slash / is added.
This behavior is originally necessary for page transitions on MPA (ref: #176, https://github.com/streamlit/streamlit/blob/1.12.2/frontend/src/App.tsx#L656-L665 ), but it became a problem in the case of stlite, which can be accessed through URLs endings with *.html.
So, a special care for such cases is needed.

@whitphx
Copy link
Owner Author

whitphx commented Aug 30, 2022

https://github.com/whitphx/streamlit/blob/d1d2b1623faded933639cc91898c17b9d1c7be46/frontend/src/App.tsx#L667-L669

This pageUrl should be fixed.

  • If it has a trailing slash like "test.html/", remove it to be "test.html".
  • However, If it is "/", keep it, because an empty string "" does not affect when passed to history.pushState()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant