Skip to content

Commit

Permalink
Add a test for URL with quotes.
Browse files Browse the repository at this point in the history
  • Loading branch information
manugarg committed Apr 13, 2022
1 parent 510a6a7 commit f013613
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/proxy.pac
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ function FindProxyForURL(url, host) {
!localHostOrDomainIs(host, "www.manugarg.com"))
return "plainhost/.manugarg.com";

// Test single quote handling in URL.
if (/.*%27.*/.test(url)) {
return "URLHasQuotes";
}

// Return externaldomain if host matches .*\.externaldomain\.com
if (/.*\.externaldomain\.com/.test(host))
return "externaldomain";
Expand Down
1 change: 1 addition & 0 deletions tests/testdata
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
-c 0.0.0.0 -u http://www.google.co.in|END-OF-SCRIPT
-u http://host1|plainhost/.manugarg.com
-u http://www1.manugarg.com|plainhost/.manugarg.com
-u http://www.manugarg.org/test'o'rama|URLHasQuotes
-u http://manugarg.externaldomain.com|externaldomain
-u http://www.google.com|isResolvable # INTERNET_REQUIRED
-u http://www.notresolvabledomainXXX.com|isNotResolvable
Expand Down

0 comments on commit f013613

Please sign in to comment.