From 26d692715d2f7f38d8101a930089eb7fc3289f65 Mon Sep 17 00:00:00 2001 From: Mikkel Malmberg Date: Sun, 21 Feb 2016 00:17:51 +0100 Subject: [PATCH] Include optional port in origin header --- bin/djsd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/djsd b/bin/djsd index 43cf413..4368513 100755 --- a/bin/djsd +++ b/bin/djsd @@ -48,7 +48,7 @@ dotjs = Class.new(WEBrick::HTTPServlet::AbstractServlet) do def detect_origin(req) path = req.path origin = req.header['origin'] - search = path.gsub('/','').gsub(/\.js$/,'') + '$' + search = path.gsub('/','').gsub(/\.js$/,'') + '(:\d+)?$' if origin.length == 1 && path.length != 1 && origin[0].match(search) origin[0]