Skip to content

Commit

Permalink
fixes #643 HTTP CORS proxy URLs with nested domains
Browse files Browse the repository at this point in the history
  • Loading branch information
danielweck committed Sep 6, 2017
1 parent 004eec2 commit 31376e1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/js/EpubLibraryOPDS.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ URI){
// Ensures URLs like http://crossorigin.me/http://domain.com/etc
// do not end-up loosing the double forward slash in http://domain.com
// (because of URI.absoluteTo() path normalisation)
var CORS_PROXY_HTTP_TOKEN_ESCAPED = "%2Fhttp%3A%2F%2F";
var CORS_PROXY_HTTPS_TOKEN_ESCAPED = "%2Fhttps%3A%2F%2F";
var CORS_PROXY_HTTP_TOKEN_ESCAPED = "/http%3A%2F%2F";
var CORS_PROXY_HTTPS_TOKEN_ESCAPED = "/https%3A%2F%2F";

// case-insensitive regexp for percent-escapes
var regex_CORS_PROXY_HTTPs_TOKEN_ESCAPED = new RegExp("%2F(http[s]?)%3A%2F%2F", "gi");
var regex_CORS_PROXY_HTTPs_TOKEN_ESCAPED = new RegExp("/(http[s]?)%3A%2F%2F", "gi");

var xOriginProxy = undefined;

Expand Down
6 changes: 3 additions & 3 deletions src/js/EpubReader.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,11 @@ BookmarkData){
// Ensures URLs like http://crossorigin.me/http://domain.com/etc
// do not end-up loosing the double forward slash in http://domain.com
// (because of URI.absoluteTo() path normalisation)
var CORS_PROXY_HTTP_TOKEN_ESCAPED = "%2Fhttp%3A%2F%2F";
var CORS_PROXY_HTTPS_TOKEN_ESCAPED = "%2Fhttps%3A%2F%2F";
var CORS_PROXY_HTTP_TOKEN_ESCAPED = "/http%3A%2F%2F";
var CORS_PROXY_HTTPS_TOKEN_ESCAPED = "/https%3A%2F%2F";

// case-insensitive regexp for percent-escapes
var regex_CORS_PROXY_HTTPs_TOKEN_ESCAPED = new RegExp("%2F(http[s]?)%3A%2F%2F", "gi");
var regex_CORS_PROXY_HTTPs_TOKEN_ESCAPED = new RegExp("/(http[s]?)%3A%2F%2F", "gi");

var appUrl =
window.location ? (
Expand Down

0 comments on commit 31376e1

Please sign in to comment.