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

key value pairs with no value from an html form submit (get) #35

Open
badbettty opened this issue Aug 1, 2023 · 1 comment
Open

key value pairs with no value from an html form submit (get) #35

badbettty opened this issue Aug 1, 2023 · 1 comment

Comments

@badbettty
Copy link

badbettty commented Aug 1, 2023

hello

If a snooze 'route' (defroute) receives a 'get' url sent from submitting from an html form (or via cURL or Wget for that matter) that is, just for example:

path/name?param1=&param2=&param3= , or path/name?param3=, or path/name?param2=&param1= , or path/name?param1=&param2="something" etc

received by: (defroute path (:get :text/* name &key param1 param2 param3) ...

The fact that there is effectively no 'value' after the '=', seems to cause snooze to throw an error ( e.g. 400 Bad Request ). Other than in that 'no value' case, all seems fine.

Advice question please: is there a way to go about setting up snooze to handle value-less url query params ?

(as in the case of an html form default behaviour - no javascript - will send all contents even if empty)

Regards to all
Cheers
Habs

@mdbergmann
Copy link

mdbergmann commented May 10, 2024

Not sure, didn't try it, but would it be possible to setup default values for the &key parameters? I mean, without default value the parameters are mandatory (in CL).
If a GET request has a query parameter with empty value it seems to be optional.

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