Skip to content

Commit

Permalink
For #1488, improve coverage for parsing client ip.
Browse files Browse the repository at this point in the history
  • Loading branch information
winlinvip committed Dec 26, 2019
1 parent 2115d5d commit 32a2b7f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions trunk/src/utest/srs_utest_http.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1711,6 +1711,16 @@ VOID TEST(ProtocolHTTPTest, GetOriginalIP)
EXPECT_STREQ("172.14.42.78", srs_get_original_ip(&m).c_str());
}

if (true) {
SrsHttpHeader h;
h.set("X-Real-IP", "172.14.42.79:15425");

SrsHttpMessage m;
m.set_header(&h, false);

EXPECT_STREQ("172.14.42.79", srs_get_original_ip(&m).c_str());
}

if (true) {
SrsHttpHeader h;

Expand Down

0 comments on commit 32a2b7f

Please sign in to comment.