cal.diy icon indicating copy to clipboard operation
cal.diy copied to clipboard

Slash (`/`) in meeting URLs throws a 404

Open AnandChowdhary opened this issue 4 years ago • 4 comments

Found a bug? Please fill out the sections below. 👍

Issue Summary

When editing an event type, you can add a URL with a slash (/). For example, I tried to set up cal.com/anand/hiring/20 for a 20-minute introductory call for hiring. However, this throws a 404 error since the slug only matches one level of route param.

We should either add validation to prevent the use of certain special characters like slash, question mark, and hash, which are reserved for URLs. Alternately, we should allow nested URLs (which would be awesome since I can use /hiring/etc!) and update the route matching for it. In Next.js for example, the file name [name].jsx should be replaced with [...name].jsx to support this.

CleanShot 2022-02-07 at 23 17 26@2x

Steps to Reproduce

  1. Click on an event to edit it
  2. Add a URL with a slash in it
  3. Save the event
  4. Try to open the event

AnandChowdhary avatar Feb 07 '22 17:02 AnandChowdhary

i think nested routes could cause many side effects so we rather not allow it but we could add a duration overwrite hiring/15 overwrites the hiring event-types duration from 20 to 15

PeerRich avatar Feb 07 '22 18:02 PeerRich

That's a good idea! For now, maybe the best is to not allow a slash in the URL?

AnandChowdhary avatar Feb 07 '22 18:02 AnandChowdhary

Hi everyone, can I add the validation to disallow / in the URL

Jenietoc avatar Feb 07 '22 19:02 Jenietoc

Hi everyone, can I add the validation to disallow / in the URL

sure go for it! Thank you @Jenietoc

PeerRich avatar Feb 07 '22 19:02 PeerRich