Skip to content

Instantly share code, notes, and snippets.

@postwait
Created January 7, 2015 15:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save postwait/e524838b9c1c05e3da79 to your computer and use it in GitHub Desktop.
Save postwait/e524838b9c1c05e3da79 to your computer and use it in GitHub Desktop.
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