Created
January 7, 2015 15:12
-
-
Save postwait/e524838b9c1c05e3da79 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/modules-lua/noit/module/http.lua b/src/modules-lua/noit/module/http.lua | |
index fd28676..af05d0f 100644 | |
--- a/src/modules-lua/noit/module/http.lua | |
+++ b/src/modules-lua/noit/module/http.lua | |
@@ -302,7 +302,7 @@ end | |
function initiate(module, check) | |
local config = check.interpolate(check.config) | |
local url = config.url or 'http:///' | |
- local schema, host, port, uri = string.match(url, "^(https?)://([^:/]*):?([0-9]*)(/?.*)$"); | |
+ local schema, host, sep, port, uri = string.match(url, "^(https?)://([^:/]*)(:?)([0-9]*)(/?.*)$"); | |
local use_ssl = false | |
local codere = noit.pcre(config.code or '^200$') | |
local good = false | |
@@ -321,7 +321,9 @@ function initiate(module, check) | |
check.unavailable() | |
if host == nil then host = check.target end | |
- if host_header == nil then host_header = host end | |
+ if host_header == nil then | |
+ host_header = host .. (sep or '') .. (port or '') | |
+ end | |
if schema == nil then | |
schema = 'http' | |
uri = '/' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment