Skip to content

Commit

Permalink
parse_object_value: prevent URLs to be interpreted as a query string …
Browse files Browse the repository at this point in the history
…value object

fix #37
  • Loading branch information
maxlath committed Nov 3, 2017
1 parent f09da55 commit b93e37e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/edit/parse_object_value.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ module.exports = value => {
}
}

// Don't let strings including special characters
// go through the query string parser.
// Especially, don't let URLs be interpreted as a query string.
// The test here after rely on the fact that object values
// never have a key with special characters
if (/\W+/.test(value.split('=')[0])) return value

// query string parser
const equalCount = countChar(value, '=')
const andCount = countChar(value, '&')
Expand Down

0 comments on commit b93e37e

Please sign in to comment.