ghowland / web6.0

Web Six Point Oh
MIT License
1 stars 5 forks source link

Web site pages without a leading slash are inaccessible #24

Open jacksontj opened 6 years ago

jacksontj commented 6 years ago

If I go to /web_site_pages and create one named foobar then if I go to localhost:/foobar the page is inaccessible. We should consolidate to either always require the leading slash or not -- and at a minimum not allow users to create pages that can never be accessed.

zelin-l commented 6 years ago

@jacksontj currently if you just add foobar without "/" the link would be localhost:9000foobar which would be inaccessible (vs. localhost:9000/foobar)

There could be two possible changes here:

  1. In the backend we could append "/" when fetching from the web_site_page table if we see that the leading "/" does not exist
  2. When creating the webpage through the UI the UDN code could check if there is a leading "/" and append "/" if there isn't (or prevent the user from creating web pages without the leading "/")

Which one do you think is better? My opinion is that we should require leading slashes and append it when creating it if it does not exist

jacksontj commented 6 years ago

I'm not sure what the interraction here is with prefixes for apps.

I would assume we'd want to have everything not start with a slash, then the slash is defined from outside (root or prefix). then we'd just need to check on set that the page doesn't start with a slash (meaning none of them would).

Probably worth checking in with @ghowland to get his opinion on the matter.

zelin-l commented 6 years ago

Ok will get his opinion on this when he is back. If we agree on everything not start with a slash, we'll just update the db removing all the leading slashes and add the leading slash to the backend code instead