Skip to content

Bug in upstream when have quote #20

@lihz1990

Description

@lihz1990

This is my test code, check_http_send is a directive of popular nginx module nginx_upstream_check_module

import nginx

UPSTREAM_BLOCK = """
upstream test0 {
    server 1.1.1.1:8080;
    check interval=3000 rise=2 fall=3 timeout=3000 type=http;
    check_http_send "GET /alive.html  HTTP/1.0\r\n\r\n";
    check_http_expect_alive http_2xx http_3xx;
}

upstream test1 {
    ip_hash;
    server 2.2.2.2:9000;
    check_http_send 'GET /alive.html  HTTP/1.0\r\n\r\n';
}
"""

data = nginx.loads(UPSTREAM_BLOCK)
print nginx.dumps(data)

and I got this output:

upstream test0 {
    server 1.1.1.1:8080;
    check interval=3000 rise=2 fall=3 timeout=3000 type=http;
    check_http_send GET /alive.html HTTP/1.0

;
    check_http_expect_alive http_2xx http_3xx;
}

upstream test1 {
    None;
}

There are 2 bugs here:

  • Lost double quote in check_http_send line of upstream test0 .
  • The upstream tets1 is freaky.

This is a awesome project. It will be glade to see you fix this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions