Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions help.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ <h3>Table of contents</h3>
<li><a href="#doubleurldecodematches">Double URL decode matches</a></li>
<li><a href="#urlencodematches">URL encode matches</a></li>
<li><a href="#base64decodematches">Base64 decode matches</a></li>
<li><a href="#base64encodematches">Base64 encode matches</a></li>
</ol>
</li>
<li><a href="#applyto">Apply to</a></li>
Expand Down Expand Up @@ -112,6 +113,8 @@ <h4>Basic usage</h4>

<li><a name="base64decodematches"></a><strong>Base64 Decode matches:</strong> Similar to URL Decoding, in some cases a parameter in a url might be Base64 encoded. This option will decode that parameter before using it in the target url.
</li>
<li><a name="base64encodematches"></a><strong>Base64 Encode matches:</strong> The opposite of Base64 Decode. This option will encode the matched parameter using Base64 encoding before using it in the target url.
</li>
</ul>
</li>

Expand Down
5 changes: 4 additions & 1 deletion js/redirect.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ Redirect.prototype = {
urlEncode : 'E.g. turn /bar/foo?x=2 into %2Fbar%2Ffoo%3Fx%3D2',
urlDecode : 'E.g. turn %2Fbar%2Ffoo%3Fx%3D2 into /bar/foo?x=2',
doubleUrlDecode : 'E.g. turn %252Fbar%252Ffoo%253Fx%253D2 into /bar/foo?x=2',
base64Encode : 'E.g. turn http://cnn.com into aHR0cDovL2Nubi5jb20=',
base64Decode : 'E.g. turn aHR0cDovL2Nubi5jb20= into http://cnn.com'
};

Expand Down Expand Up @@ -281,7 +282,9 @@ Redirect.prototype = {
repl = unescape(unescape(repl));
} else if (this.processMatches == 'urlEncode') {
repl = encodeURIComponent(repl);
} else if (this.processMatches == 'base64decode') {
} else if (this.processMatches == 'base64Encode') {
repl = btoa(repl);
} else if (this.processMatches == 'base64Decode') {
if (repl.indexOf('%') > -1) {
repl = unescape(repl);
}
Expand Down
3 changes: 2 additions & 1 deletion redirector.html
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ <h3>Create Redirect</h3>
<option value="urlEncode">URL Encode</option>
<option value="urlDecode">URL Decode</option>
<option value="doubleUrlDecode">Double URL Decode</option>
<option value="base64decode">Base64 Decode</option>
<option value="base64Encode">Base64 Encode</option>
<option value="base64Decode">Base64 Decode</option>
</select>
<span class="placeholder" data-bind="processMatchesExampleText"></span>
</div>
Expand Down