Skip to content

Making sure query string parameters are encoded#161

Merged
maikebing merged 2 commits intoIoTSharp:masterfrom
AT-WH:master
May 6, 2025
Merged

Making sure query string parameters are encoded#161
maikebing merged 2 commits intoIoTSharp:masterfrom
AT-WH:master

Conversation

@AT-WH
Copy link
Copy Markdown
Contributor

@AT-WH AT-WH commented May 6, 2025

This PR fixes the following error:

1.) Create a Job with a name containing a special character (I used M&S)
2.) Save it and return to Jobs Index view.
3.) For the newly created job, click on the dots and select Copy from the menu.
image
4.) The application errors out with 500 error.

This is because the Job's name is passed using query string which leads to unexpected behaviour if not handled carefully.
In this case the query string ended up being:

?group=DEFAULT&name=M&S

Which looks like S was another parameter without value. Instead, the correct way to pass M&S is:

?group=DEFAULT&name=M%26S

The same problem applies to triggers' names, which I also fixed in this PR.

@maikebing maikebing merged commit 02bdbb9 into IoTSharp:master May 6, 2025
1 check passed
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

Successfully merging this pull request may close these issues.

2 participants