Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nghttp2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
nghttp2
Commits
124d4c9f
Commit
124d4c9f
authored
Feb 28, 2016
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
src: Fix tests
parent
5fbe4cc2
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
247 additions
and
136 deletions
+247
-136
src/Makefile.am
src/Makefile.am
+1
-0
src/shrpx-unittest.cc
src/shrpx-unittest.cc
+3
-2
src/shrpx_config_test.cc
src/shrpx_config_test.cc
+0
-116
src/shrpx_downstream_test.cc
src/shrpx_downstream_test.cc
+2
-2
src/shrpx_http_test.cc
src/shrpx_http_test.cc
+14
-11
src/shrpx_worker_test.cc
src/shrpx_worker_test.cc
+179
-0
src/shrpx_worker_test.h
src/shrpx_worker_test.h
+38
-0
src/util_test.cc
src/util_test.cc
+10
-5
No files found.
src/Makefile.am
View file @
124d4c9f
...
...
@@ -169,6 +169,7 @@ nghttpx_unittest_SOURCES = shrpx-unittest.cc \
shrpx_ssl_test.cc shrpx_ssl_test.h
\
shrpx_downstream_test.cc shrpx_downstream_test.h
\
shrpx_config_test.cc shrpx_config_test.h
\
shrpx_worker_test.cc shrpx_worker_test.h
\
shrpx_http_test.cc shrpx_http_test.h
\
http2_test.cc http2_test.h
\
util_test.cc util_test.h
\
...
...
src/shrpx-unittest.cc
View file @
124d4c9f
...
...
@@ -33,6 +33,7 @@
#include "shrpx_ssl_test.h"
#include "shrpx_downstream_test.h"
#include "shrpx_config_test.h"
#include "shrpx_worker_test.h"
#include "http2_test.h"
#include "util_test.h"
#include "nghttp2_gzip_test.h"
...
...
@@ -118,8 +119,8 @@ int main(int argc, char *argv[]) {
shrpx
::
test_shrpx_config_read_tls_ticket_key_file
)
||
!
CU_add_test
(
pSuite
,
"config_read_tls_ticket_key_file_aes_256"
,
shrpx
::
test_shrpx_config_read_tls_ticket_key_file_aes_256
)
||
!
CU_add_test
(
pSuite
,
"
config
_match_downstream_addr_group"
,
shrpx
::
test_shrpx_
config
_match_downstream_addr_group
)
||
!
CU_add_test
(
pSuite
,
"
worker
_match_downstream_addr_group"
,
shrpx
::
test_shrpx_
worker
_match_downstream_addr_group
)
||
!
CU_add_test
(
pSuite
,
"http_create_forwarded"
,
shrpx
::
test_shrpx_http_create_forwarded
)
||
!
CU_add_test
(
pSuite
,
"util_streq"
,
shrpx
::
test_util_streq
)
||
...
...
src/shrpx_config_test.cc
View file @
124d4c9f
...
...
@@ -238,120 +238,4 @@ void test_shrpx_config_read_tls_ticket_key_file_aes_256(void) {
"a..............................b"
));
}
void
test_shrpx_config_match_downstream_addr_group
(
void
)
{
auto
groups
=
std
::
vector
<
DownstreamAddrGroup
>
{
{
"nghttp2.org/"
},
{
"nghttp2.org/alpha/bravo/"
},
{
"nghttp2.org/alpha/charlie"
},
{
"nghttp2.org/delta%3A"
},
{
"www.nghttp2.org/"
},
{
"[::1]/"
},
{
"nghttp2.org/alpha/bravo/delta"
},
// Check that match is done in the single node
{
"example.com/alpha/bravo"
},
{
"192.168.0.1/alpha/"
},
};
Router
router
;
for
(
size_t
i
=
0
;
i
<
groups
.
size
();
++
i
)
{
auto
&
g
=
groups
[
i
];
router
.
add_route
(
StringRef
{
g
.
pattern
},
i
);
}
CU_ASSERT
(
0
==
match_downstream_addr_group
(
router
,
"nghttp2.org"
,
"/"
,
groups
,
255
));
// port is removed
CU_ASSERT
(
0
==
match_downstream_addr_group
(
router
,
"nghttp2.org:8080"
,
"/"
,
groups
,
255
));
// host is case-insensitive
CU_ASSERT
(
4
==
match_downstream_addr_group
(
router
,
"WWW.nghttp2.org"
,
"/alpha"
,
groups
,
255
));
CU_ASSERT
(
1
==
match_downstream_addr_group
(
router
,
"nghttp2.org"
,
"/alpha/bravo/"
,
groups
,
255
));
// /alpha/bravo also matches /alpha/bravo/
CU_ASSERT
(
1
==
match_downstream_addr_group
(
router
,
"nghttp2.org"
,
"/alpha/bravo"
,
groups
,
255
));
// path part is case-sensitive
CU_ASSERT
(
0
==
match_downstream_addr_group
(
router
,
"nghttp2.org"
,
"/Alpha/bravo"
,
groups
,
255
));
CU_ASSERT
(
1
==
match_downstream_addr_group
(
router
,
"nghttp2.org"
,
"/alpha/bravo/charlie"
,
groups
,
255
));
CU_ASSERT
(
2
==
match_downstream_addr_group
(
router
,
"nghttp2.org"
,
"/alpha/charlie"
,
groups
,
255
));
// pattern which does not end with '/' must match its entirely. So
// this matches to group 0, not group 2.
CU_ASSERT
(
0
==
match_downstream_addr_group
(
router
,
"nghttp2.org"
,
"/alpha/charlie/"
,
groups
,
255
));
CU_ASSERT
(
255
==
match_downstream_addr_group
(
router
,
"example.org"
,
"/"
,
groups
,
255
));
CU_ASSERT
(
255
==
match_downstream_addr_group
(
router
,
""
,
"/"
,
groups
,
255
));
CU_ASSERT
(
255
==
match_downstream_addr_group
(
router
,
""
,
"alpha"
,
groups
,
255
));
CU_ASSERT
(
255
==
match_downstream_addr_group
(
router
,
"foo/bar"
,
"/"
,
groups
,
255
));
// If path is "*", only match with host + "/".
CU_ASSERT
(
0
==
match_downstream_addr_group
(
router
,
"nghttp2.org"
,
"*"
,
groups
,
255
));
CU_ASSERT
(
5
==
match_downstream_addr_group
(
router
,
"[::1]"
,
"/"
,
groups
,
255
));
CU_ASSERT
(
5
==
match_downstream_addr_group
(
router
,
"[::1]:8080"
,
"/"
,
groups
,
255
));
CU_ASSERT
(
255
==
match_downstream_addr_group
(
router
,
"[::1"
,
"/"
,
groups
,
255
));
CU_ASSERT
(
255
==
match_downstream_addr_group
(
router
,
"[::1]8000"
,
"/"
,
groups
,
255
));
// Check the case where adding route extends tree
CU_ASSERT
(
6
==
match_downstream_addr_group
(
router
,
"nghttp2.org"
,
"/alpha/bravo/delta"
,
groups
,
255
));
CU_ASSERT
(
1
==
match_downstream_addr_group
(
router
,
"nghttp2.org"
,
"/alpha/bravo/delta/"
,
groups
,
255
));
// Check the case where query is done in a single node
CU_ASSERT
(
7
==
match_downstream_addr_group
(
router
,
"example.com"
,
"/alpha/bravo"
,
groups
,
255
));
CU_ASSERT
(
255
==
match_downstream_addr_group
(
router
,
"example.com"
,
"/alpha/bravo/"
,
groups
,
255
));
CU_ASSERT
(
255
==
match_downstream_addr_group
(
router
,
"example.com"
,
"/alpha"
,
groups
,
255
));
// Check the case where quey is done in a single node
CU_ASSERT
(
8
==
match_downstream_addr_group
(
router
,
"192.168.0.1"
,
"/alpha"
,
groups
,
255
));
CU_ASSERT
(
8
==
match_downstream_addr_group
(
router
,
"192.168.0.1"
,
"/alpha/"
,
groups
,
255
));
CU_ASSERT
(
8
==
match_downstream_addr_group
(
router
,
"192.168.0.1"
,
"/alpha/bravo"
,
groups
,
255
));
CU_ASSERT
(
255
==
match_downstream_addr_group
(
router
,
"192.168.0.1"
,
"/alph"
,
groups
,
255
));
CU_ASSERT
(
255
==
match_downstream_addr_group
(
router
,
"192.168.0.1"
,
"/"
,
groups
,
255
));
router
.
dump
();
}
}
// namespace shrpx
src/shrpx_downstream_test.cc
View file @
124d4c9f
...
...
@@ -77,8 +77,8 @@ void test_downstream_field_store_header(void) {
CU_ASSERT
(
nullptr
==
fs
.
header
(
http2
::
HD__METHOD
));
// By name
CU_ASSERT
(
Header
(
"alpha"
,
"0"
)
==
*
fs
.
header
(
"alpha"
));
CU_ASSERT
(
nullptr
==
fs
.
header
(
"bravo"
));
CU_ASSERT
(
Header
(
"alpha"
,
"0"
)
==
*
fs
.
header
(
StringRef
::
from_lit
(
"alpha"
)
));
CU_ASSERT
(
nullptr
==
fs
.
header
(
StringRef
::
from_lit
(
"bravo"
)
));
}
void
test_downstream_crumble_request_cookie
(
void
)
{
...
...
src/shrpx_http_test.cc
View file @
124d4c9f
...
...
@@ -40,25 +40,28 @@ namespace shrpx {
void
test_shrpx_http_create_forwarded
(
void
)
{
CU_ASSERT
(
"by=
\"
example.com:3000
\"
;for=
\"
[::1]
\"
;host=
\"
www.example.com
\"
;"
"proto=https"
==
http
::
create_forwarded
(
FORWARDED_BY
|
FORWARDED_FOR
|
FORWARDED_HOST
|
FORWARDED_PROTO
,
"example.com:3000"
,
"[::1]"
,
"www.example.com"
,
"https"
));
http
::
create_forwarded
(
FORWARDED_BY
|
FORWARDED_FOR
|
FORWARDED_HOST
|
FORWARDED_PROTO
,
StringRef
::
from_lit
(
"example.com:3000"
),
"[::1]"
,
"www.example.com"
,
"https"
));
CU_ASSERT
(
"for=192.168.0.1"
==
http
::
create_forwarded
(
FORWARDED_FOR
,
"alpha"
,
"192.168.0.1"
,
"bravo"
,
"charlie"
));
CU_ASSERT
(
"for=192.168.0.1"
==
http
::
create_forwarded
(
FORWARDED_FOR
,
StringRef
::
from_lit
(
"alpha"
)
,
"192.168.0.1"
,
"bravo"
,
"charlie"
));
CU_ASSERT
(
"by=_hidden;for=
\"
[::1]
\"
"
==
http
::
create_forwarded
(
FORWARDED_BY
|
FORWARDED_FOR
,
"_hidden"
,
"[::1]"
,
""
,
""
));
http
::
create_forwarded
(
FORWARDED_BY
|
FORWARDED_FOR
,
StringRef
::
from_lit
(
"_hidden"
),
"[::1]"
,
""
,
""
));
CU_ASSERT
(
"by=
\"
[::1]
\"
;for=_hidden"
==
http
::
create_forwarded
(
FORWARDED_BY
|
FORWARDED_FOR
,
"[::1]"
,
"_hidden"
,
""
,
""
));
http
::
create_forwarded
(
FORWARDED_BY
|
FORWARDED_FOR
,
StringRef
::
from_lit
(
"[::1]"
),
"_hidden"
,
""
,
""
));
CU_ASSERT
(
""
==
http
::
create_forwarded
(
FORWARDED_BY
|
FORWARDED_FOR
|
FORWARDED_HOST
|
FORWARDED_PROTO
,
""
,
""
,
""
,
""
));
StringRef
::
from_lit
(
""
)
,
""
,
""
,
""
));
}
}
// namespace shrpx
src/shrpx_worker_test.cc
0 → 100644
View file @
124d4c9f
/*
* nghttp2 - HTTP/2 C Library
*
* Copyright (c) 2016 Tatsuhiro Tsujikawa
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include "shrpx_worker_test.h"
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif // HAVE_UNISTD_H
#include <cstdlib>
#include <CUnit/CUnit.h>
#include "shrpx_worker.h"
#include "shrpx_connect_blocker.h"
namespace
shrpx
{
void
test_shrpx_worker_match_downstream_addr_group
(
void
)
{
auto
groups
=
std
::
vector
<
DownstreamAddrGroup
>
();
for
(
auto
&
s
:
{
"nghttp2.org/"
,
"nghttp2.org/alpha/bravo/"
,
"nghttp2.org/alpha/charlie"
,
"nghttp2.org/delta%3A"
,
"www.nghttp2.org/"
,
"[::1]/"
,
"nghttp2.org/alpha/bravo/delta"
,
// Check that match is done in the single node
"example.com/alpha/bravo"
,
"192.168.0.1/alpha/"
})
{
groups
.
push_back
(
DownstreamAddrGroup
{
ImmutableString
(
s
)});
}
Router
router
;
for
(
size_t
i
=
0
;
i
<
groups
.
size
();
++
i
)
{
auto
&
g
=
groups
[
i
];
router
.
add_route
(
StringRef
{
g
.
pattern
},
i
);
}
CU_ASSERT
(
0
==
match_downstream_addr_group
(
router
,
StringRef
::
from_lit
(
"nghttp2.org"
),
StringRef
::
from_lit
(
"/"
),
groups
,
255
));
// port is removed
CU_ASSERT
(
0
==
match_downstream_addr_group
(
router
,
StringRef
::
from_lit
(
"nghttp2.org:8080"
),
StringRef
::
from_lit
(
"/"
),
groups
,
255
));
// host is case-insensitive
CU_ASSERT
(
4
==
match_downstream_addr_group
(
router
,
StringRef
::
from_lit
(
"WWW.nghttp2.org"
),
StringRef
::
from_lit
(
"/alpha"
),
groups
,
255
));
CU_ASSERT
(
1
==
match_downstream_addr_group
(
router
,
StringRef
::
from_lit
(
"nghttp2.org"
),
StringRef
::
from_lit
(
"/alpha/bravo/"
),
groups
,
255
));
// /alpha/bravo also matches /alpha/bravo/
CU_ASSERT
(
1
==
match_downstream_addr_group
(
router
,
StringRef
::
from_lit
(
"nghttp2.org"
),
StringRef
::
from_lit
(
"/alpha/bravo"
),
groups
,
255
));
// path part is case-sensitive
CU_ASSERT
(
0
==
match_downstream_addr_group
(
router
,
StringRef
::
from_lit
(
"nghttp2.org"
),
StringRef
::
from_lit
(
"/Alpha/bravo"
),
groups
,
255
));
CU_ASSERT
(
1
==
match_downstream_addr_group
(
router
,
StringRef
::
from_lit
(
"nghttp2.org"
),
StringRef
::
from_lit
(
"/alpha/bravo/charlie"
),
groups
,
255
));
CU_ASSERT
(
2
==
match_downstream_addr_group
(
router
,
StringRef
::
from_lit
(
"nghttp2.org"
),
StringRef
::
from_lit
(
"/alpha/charlie"
),
groups
,
255
));
// pattern which does not end with '/' must match its entirely. So
// this matches to group 0, not group 2.
CU_ASSERT
(
0
==
match_downstream_addr_group
(
router
,
StringRef
::
from_lit
(
"nghttp2.org"
),
StringRef
::
from_lit
(
"/alpha/charlie/"
),
groups
,
255
));
CU_ASSERT
(
255
==
match_downstream_addr_group
(
router
,
StringRef
::
from_lit
(
"example.org"
),
StringRef
::
from_lit
(
"/"
),
groups
,
255
));
CU_ASSERT
(
255
==
match_downstream_addr_group
(
router
,
StringRef
::
from_lit
(
""
),
StringRef
::
from_lit
(
"/"
),
groups
,
255
));
CU_ASSERT
(
255
==
match_downstream_addr_group
(
router
,
StringRef
::
from_lit
(
""
),
StringRef
::
from_lit
(
"alpha"
),
groups
,
255
));
CU_ASSERT
(
255
==
match_downstream_addr_group
(
router
,
StringRef
::
from_lit
(
"foo/bar"
),
StringRef
::
from_lit
(
"/"
),
groups
,
255
));
// If path is StringRef::from_lit("*", only match with host + "/").
CU_ASSERT
(
0
==
match_downstream_addr_group
(
router
,
StringRef
::
from_lit
(
"nghttp2.org"
),
StringRef
::
from_lit
(
"*"
),
groups
,
255
));
CU_ASSERT
(
5
==
match_downstream_addr_group
(
router
,
StringRef
::
from_lit
(
"[::1]"
),
StringRef
::
from_lit
(
"/"
),
groups
,
255
));
CU_ASSERT
(
5
==
match_downstream_addr_group
(
router
,
StringRef
::
from_lit
(
"[::1]:8080"
),
StringRef
::
from_lit
(
"/"
),
groups
,
255
));
CU_ASSERT
(
255
==
match_downstream_addr_group
(
router
,
StringRef
::
from_lit
(
"[::1"
),
StringRef
::
from_lit
(
"/"
),
groups
,
255
));
CU_ASSERT
(
255
==
match_downstream_addr_group
(
router
,
StringRef
::
from_lit
(
"[::1]8000"
),
StringRef
::
from_lit
(
"/"
),
groups
,
255
));
// Check the case where adding route extends tree
CU_ASSERT
(
6
==
match_downstream_addr_group
(
router
,
StringRef
::
from_lit
(
"nghttp2.org"
),
StringRef
::
from_lit
(
"/alpha/bravo/delta"
),
groups
,
255
));
CU_ASSERT
(
1
==
match_downstream_addr_group
(
router
,
StringRef
::
from_lit
(
"nghttp2.org"
),
StringRef
::
from_lit
(
"/alpha/bravo/delta/"
),
groups
,
255
));
// Check the case where query is done in a single node
CU_ASSERT
(
7
==
match_downstream_addr_group
(
router
,
StringRef
::
from_lit
(
"example.com"
),
StringRef
::
from_lit
(
"/alpha/bravo"
),
groups
,
255
));
CU_ASSERT
(
255
==
match_downstream_addr_group
(
router
,
StringRef
::
from_lit
(
"example.com"
),
StringRef
::
from_lit
(
"/alpha/bravo/"
),
groups
,
255
));
CU_ASSERT
(
255
==
match_downstream_addr_group
(
router
,
StringRef
::
from_lit
(
"example.com"
),
StringRef
::
from_lit
(
"/alpha"
),
groups
,
255
));
// Check the case where quey is done in a single node
CU_ASSERT
(
8
==
match_downstream_addr_group
(
router
,
StringRef
::
from_lit
(
"192.168.0.1"
),
StringRef
::
from_lit
(
"/alpha"
),
groups
,
255
));
CU_ASSERT
(
8
==
match_downstream_addr_group
(
router
,
StringRef
::
from_lit
(
"192.168.0.1"
),
StringRef
::
from_lit
(
"/alpha/"
),
groups
,
255
));
CU_ASSERT
(
8
==
match_downstream_addr_group
(
router
,
StringRef
::
from_lit
(
"192.168.0.1"
),
StringRef
::
from_lit
(
"/alpha/bravo"
),
groups
,
255
));
CU_ASSERT
(
255
==
match_downstream_addr_group
(
router
,
StringRef
::
from_lit
(
"192.168.0.1"
),
StringRef
::
from_lit
(
"/alph"
),
groups
,
255
));
CU_ASSERT
(
255
==
match_downstream_addr_group
(
router
,
StringRef
::
from_lit
(
"192.168.0.1"
),
StringRef
::
from_lit
(
"/"
),
groups
,
255
));
router
.
dump
();
}
}
// namespace shrpx
src/shrpx_worker_test.h
0 → 100644
View file @
124d4c9f
/*
* nghttp2 - HTTP/2 C Library
*
* Copyright (c) 2016 Tatsuhiro Tsujikawa
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef SHRPX_WORKER_TEST_H
#define SHRPX_WORKER_TEST_H
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif // HAVE_CONFIG_H
namespace
shrpx
{
void
test_shrpx_worker_match_downstream_addr_group
(
void
);
}
// namespace shrpx
#endif // SHRPX_WORKER_TEST_H
src/util_test.cc
View file @
124d4c9f
...
...
@@ -456,14 +456,19 @@ void test_util_parse_config_str_list(void) {
}
void
test_util_make_http_hostport
(
void
)
{
CU_ASSERT
(
"localhost"
==
util
::
make_http_hostport
(
"localhost"
,
80
));
CU_ASSERT
(
"[::1]"
==
util
::
make_http_hostport
(
"::1"
,
443
));
CU_ASSERT
(
"localhost:3000"
==
util
::
make_http_hostport
(
"localhost"
,
3000
));
CU_ASSERT
(
"localhost"
==
util
::
make_http_hostport
(
StringRef
::
from_lit
(
"localhost"
),
80
));
CU_ASSERT
(
"[::1]"
==
util
::
make_http_hostport
(
StringRef
::
from_lit
(
"::1"
),
443
));
CU_ASSERT
(
"localhost:3000"
==
util
::
make_http_hostport
(
StringRef
::
from_lit
(
"localhost"
),
3000
));
}
void
test_util_make_hostport
(
void
)
{
CU_ASSERT
(
"localhost:80"
==
util
::
make_hostport
(
"localhost"
,
80
));
CU_ASSERT
(
"[::1]:443"
==
util
::
make_hostport
(
"::1"
,
443
));
CU_ASSERT
(
"localhost:80"
==
util
::
make_hostport
(
StringRef
::
from_lit
(
"localhost"
),
80
));
CU_ASSERT
(
"[::1]:443"
==
util
::
make_hostport
(
StringRef
::
from_lit
(
"::1"
),
443
));
}
}
// namespace shrpx
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment