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

The fallback github url has additional "/" in path #306

Open
imsaravana369 opened this issue Mar 13, 2023 · 4 comments
Open

The fallback github url has additional "/" in path #306

imsaravana369 opened this issue Mar 13, 2023 · 4 comments

Comments

@imsaravana369
Copy link

When we hit TryPurescript without any queryparams it needs to fallback back to mainGitHubExample,

mainGitHubExample :: String
mainGitHubExample = "/purescript/trypurescript/" <> tag <> "/client/examples/Main.purs"

mkGitHubUrl :: String -> URL
mkGitHubUrl id = "https://raw.githubusercontent.com/" <> id

when we call

>>> mkGitHubUrl mainGitHubExample

The resulting url is having an additional "/". This is crashing TryPurescript.
https://try.purescript.org

@JordanMartinez
Copy link
Contributor

I think what you're saying is:

  1. Load a file using the GitHub url query param (e.g. a cookbook link: https://try.purescript.org/?github=/JordanMartinez/purescript-cookbook/master/recipes/BigIntJs/src/Main.purs)
  2. Click on the View Mode's GitHub menu item
  3. User sees "Not Found" error

Is that what you meant?

@imsaravana369
Copy link
Author

Try opening https://try.purescript.org/ in incognito (to not load things from cache)...
trypurescripterror

@imsaravana369
Copy link
Author

It's seems to be occuring the first time only (options call)

@JordanMartinez
Copy link
Contributor

I just tried opening https://try.purescript.org/ in incognito mode and didn't get the above error.

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

No branches or pull requests

2 participants