Skip to content

Commit

Permalink
url: ~ is not actually an unwise char
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Apr 12, 2013
1 parent 17a379e commit 881ef7c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/url.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ var protocolPattern = /^([a-z0-9.+-]+:)/i,
delims = ['<', '>', '"', '`', ' ', '\r', '\n', '\t'],

// RFC 2396: characters not allowed for various reasons.
unwise = ['{', '}', '|', '\\', '^', '~', '`'].concat(delims),
unwise = ['{', '}', '|', '\\', '^', '`'].concat(delims),

// Allowed by RFCs, but cause of XSS attacks. Always escape these.
autoEscape = ['\''].concat(unwise),
Expand Down
6 changes: 3 additions & 3 deletions test/simple/test-url.js
Original file line number Diff line number Diff line change
Expand Up @@ -747,9 +747,9 @@ var parseTests = {
host: 'x:1',
port: '1',
hostname: 'x',
pathname: '/%27%20%3C%3E%22%60/%7B%7D%7C%5C%5E%7E%60/',
path: '/%27%20%3C%3E%22%60/%7B%7D%7C%5C%5E%7E%60/',
href: 'http://x:1/%27%20%3C%3E%22%60/%7B%7D%7C%5C%5E%7E%60/'
pathname: '/%27%20%3C%3E%22%60/%7B%7D%7C%5C%5E~%60/',
path: '/%27%20%3C%3E%22%60/%7B%7D%7C%5C%5E~%60/',
href: 'http://x:1/%27%20%3C%3E%22%60/%7B%7D%7C%5C%5E~%60/'
},

};
Expand Down

0 comments on commit 881ef7c

Please sign in to comment.