[Pkg-javascript-commits] [sockjs-client] 56/350: Fix utils.getOrigin for file:// urls
tonnerre at ancient-solutions.com
tonnerre at ancient-solutions.com
Fri Aug 5 01:03:41 UTC 2016
This is an automated email from the git hooks/post-receive script.
tonnerre-guest pushed a commit to branch upstream
in repository sockjs-client.
commit a668b537c0ba59d39256bda50ba12792b63a637e
Author: Paweł Ledwoń <me at ludvik.pl>
Date: Fri Mar 15 15:26:22 2013 +0000
Fix utils.getOrigin for file:// urls
---
lib/utils.js | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/lib/utils.js b/lib/utils.js
index 2e4efff..155ff7e 100644
--- a/lib/utils.js
+++ b/lib/utils.js
@@ -41,8 +41,12 @@ utils.random_number_string = function(max) {
return (p + utils.random_number(max)).slice(-t);
};
-// Assuming that url looks like: http://asdasd:111/asd
utils.getOrigin = function(url) {
+ if (url.match(/^file:\/\//)) {
+ // no origin when using file protocol
+ return null;
+ }
+
var parts = url.split('/');
var protocol = parts[0];
var host = parts[2];
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/sockjs-client.git
More information about the Pkg-javascript-commits
mailing list