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

Escaped characters in URLs with hashes working for deno fileserver but not Python #45

Closed
Tracked by #29
Pat-Laub opened this issue Dec 15, 2021 · 3 comments · Fixed by #57
Closed
Tracked by #29

Escaped characters in URLs with hashes working for deno fileserver but not Python #45

Pat-Laub opened this issue Dec 15, 2021 · 3 comments · Fixed by #57
Labels
bug Something isn't working Pluto.jl frontend Requires integration with/changes to Pluto's frontend (JS) codebase

Comments

@Pat-Laub
Copy link

Firstly, thanks for producing this really cool software! I'm planning to use Pluto (especially with precomputed static outputs) as much as possible now :)

I was just trying the precomputed static html branch (though I would guess this behaviour is unrelated to the pre-computation), and found that sometimes I would get 404 error when trying to load the bond connections file, and the dynamic content would fail.

Specifically, I generated a static HTML output using

PlutoSliderServer.export_notebook("basic3.jl", Precompute_enabled=true)

on the basic3.jl test file, then if I ran

deno run --allow-net --allow-read https://deno.land/std@0.115.0/http/file_server.ts .  --port 8000

the localhost:8000/basic3.html page would work as expected, whereas if instead I tried Python's built-in server

python3 -m http.server 8000

then the Javascript console would show a 404 error trying to load bondconnections and the interactivity would not work anymore.

Javascript prints out the same notebook hash in both cases, 7uehaeBoJorFiesT4uKI7Rl3bFJcsQwdILATmeaacfs=, and both links request

http://localhost:8000/bondconnections/7uehaeBoJorFiesT4uKI7Rl3bFJcsQwdILATmeaacfs%3D

however Python's server will only load this file if the URL used is

http://localhost:8000/bondconnections/7uehaeBoJorFiesT4uKI7Rl3bFJcsQwdILATmeaacfs%253D

The difference appears to be a different escaping mechanism for the URL (Python wanting the escaped characters to have '25' after each '%').

Having the Python server supported is not important, I was simply hoping to put the precomputed html files onto Github Pages and I spotted this problem there. Using Python locally was just a convenient way to reproduce this error. I'm not a web developer, so I hope this isn't simply some trivial error caused by my ignorance! Thanks.

@fonsp
Copy link
Member

fonsp commented Jan 5, 2022

Thanks for narrowing down on the problem! I am currently taking a small break from PlutoSliderServer but I will pick it up in about a month :)

behinger added a commit to behinger/PlutoSliderServer.jl that referenced this issue Jan 12, 2022
@fonsp fonsp linked a pull request Mar 7, 2022 that will close this issue
4 tasks
@fonsp fonsp closed this as completed in #57 Apr 4, 2022
@fonsp fonsp added bug Something isn't working Pluto.jl frontend Requires integration with/changes to Pluto's frontend (JS) codebase labels Apr 5, 2022
@fonsp
Copy link
Member

fonsp commented Apr 11, 2022

I just updated #29 from main which includes my fix! Try again now

@fonsp
Copy link
Member

fonsp commented Apr 11, 2022

Also @Pat-Laub please let me know how #29 is working for you! Are there any missing features? Is it easy to write notebooks that will work precomputed? Do you often get too many possibilities?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Pluto.jl frontend Requires integration with/changes to Pluto's frontend (JS) codebase
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants