Is your feature request related to a problem? Please describe.
I errantly copied and pasted a trailing whitespace into a redirection host destination field which resulted in an invalid nginx config because the whitespace broke the expected syntax of the nginx redirect directive:
# this
return 301 $scheme://example.com/example/?_vsrefdom=web_default $request_uri;
# instead of this
return 301 $scheme://example.com/example/?_vsrefdom=web_default$request_uri;
[12/18/2020] [3:49:09 PM] [Express ] › ⚠ warning Command failed: /usr/sbin/nginx -t -g "error_log off;"
nginx: [emerg] invalid number of arguments in "return" directive in /data/nginx/redirection_host/1.conf:33
nginx: configuration file /etc/nginx/nginx.conf test failed
I am also able to paste a full URL with the scheme and it is accepted even though it would result in an invalid redirect.
Describe the solution you'd like
I am attempting to provide a self-service redirection portal to less-technical users and adding blocking input validation checks prior to submission will likely alleviate future pain. A regex input validation step would be tremendously helpful in filtering out some of the inappropriate input that less-technical users will likely copy and paste into that field.
I'm not a JS developer, but perhaps something like Backbone.Validation would help.
Describe alternatives you've considered
npm is a blessing and thank you for providing it. I understand you are not compensated for your efforts. We could probably get by with training our staff to look for whitespace and scheme prior to submitting a redirect. However it would help me sleep better at night knowing they can't easily break the nginx config and require an engineer to log in and repair it.
Is your feature request related to a problem? Please describe. I errantly copied and pasted a trailing whitespace into a redirection host destination field which resulted in an invalid nginx config because the whitespace broke the expected syntax of the nginx redirect directive:
I am also able to paste a full URL with the scheme and it is accepted even though it would result in an invalid redirect.
Describe the solution you'd like I am attempting to provide a self-service redirection portal to less-technical users and adding blocking input validation checks prior to submission will likely alleviate future pain. A regex input validation step would be tremendously helpful in filtering out some of the inappropriate input that less-technical users will likely copy and paste into that field.
I'm not a JS developer, but perhaps something like Backbone.Validation would help.
Describe alternatives you've considered npm is a blessing and thank you for providing it. I understand you are not compensated for your efforts. We could probably get by with training our staff to look for whitespace and scheme prior to submitting a redirect. However it would help me sleep better at night knowing they can't easily break the nginx config and require an engineer to log in and repair it.
Additional context![image](https://user-images.githubusercontent.com/18486187/102635637-3b4fb780-4119-11eb-9523-9b72da0eab7a.png)