Skip to content

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 :)

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