watchman icon indicating copy to clipboard operation
watchman copied to clipboard

URL-encode the check path automatically, or reject bad paths

Open cespare opened this issue 12 years ago • 0 comments

Writing graphite/shadow checks, I end up with a lot of characters (*, {, <, ...) that require url-encoding. Otherwise, you get an exception from the http request (which is masked and shown to the user as "Error connecting...").

Two options:

  • URL-encode the path that the user gives (either before storing it to the DB, or each time before running the check). This will allow the user to supply a more human-readable URL, but will confuse a user that supplies a URL that's already encoded.
  • Check the validity of a URL by parsing it using the same library that http/get uses. If this fails, alert the user instead of allowing him/her to set a bad check.

Thoughts?

cespare avatar Oct 22 '13 06:10 cespare