purescript/trypurescript

The fallback github url has additional "/" in path

imsaravana369 opened this issue · 4 comments

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

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?

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

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

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