Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I improved healthcheck library so that it supports contains / exact matc... #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rcosnita
Copy link

@rcosnita rcosnita commented Nov 4, 2014

I recently needed to monitor upstreams and decided based on received body if an upstream member is healthy or not. I updated your library so that it supports this.

@agentzh
Copy link
Member

agentzh commented Nov 6, 2014

@rcosnita This has been on my TODO list and I'm glad you have looked into this! I'll check out your patch as soon as I can manage. Thank you!

@runningman84
Copy link

any news here?

@rcosnita
Copy link
Author

As far as I know the change was not integrated.

@agentzh
Copy link
Member

agentzh commented May 29, 2015

I'll look into this :)

}

if ctx.http_version ~= "1.1" or ctx.http_version ~= "1.0" then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't this be an AND operator?

You probably want;

if ctx.http_version ~= "1.0" then
    ctx.http_version = "1.1"
end

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just commented on the line, but actually the checks should be done further up, before the ctx table is created.

and then it should be something like;

local http_allowed = { ["1.0"] = true, ["1.1"] = true }

local http_version = opts.http_version or "1.1"
if not http_allowed[http_version] then
    return nil, "invalid http version: "..tostring(http_version)
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants