Commit 03a5cf8 1 parent c197a18 commit 03a5cf8 Copy full SHA for 03a5cf8
File tree 5 files changed +15
-14
lines changed
5 files changed +15
-14
lines changed Original file line number Diff line number Diff line change @@ -1546,20 +1546,21 @@ class coro_http_client : public std::enable_shared_from_this<coro_http_client> {
1546
1546
if (!proxy_host_.empty () && !proxy_port_.empty ()) {
1547
1547
if (!proxy_request_uri_.empty ())
1548
1548
proxy_request_uri_.clear ();
1549
- if (u.get_port () == " http" ) {
1550
- proxy_request_uri_ += " http://" + u.get_host () + " :" ;
1551
- proxy_request_uri_ += " 80" ;
1549
+ if (u.get_port () == " 80" ) {
1550
+ proxy_request_uri_.append (" http://" ).append (u.get_host ()).append (" :80" );
1552
1551
}
1553
- else if (u.get_port () == " https" ) {
1554
- proxy_request_uri_ += " https://" + u.get_host () + " :" ;
1555
- proxy_request_uri_ += " 443" ;
1552
+ else if (u.get_port () == " 443" ) {
1553
+ proxy_request_uri_.append (" https://" )
1554
+ .append (u.get_host ())
1555
+ .append (" :443" );
1556
1556
}
1557
1557
else {
1558
1558
// all be http
1559
- proxy_request_uri_ += " http://" + u.get_host () + " :" ;
1560
- proxy_request_uri_ += u.get_port ();
1559
+ proxy_request_uri_.append (" http://" )
1560
+ .append (u.get_host ())
1561
+ .append (u.get_port ());
1561
1562
}
1562
- proxy_request_uri_ += u.get_path ();
1563
+ proxy_request_uri_. append ( u.get_path () );
1563
1564
u.path = std::string_view (proxy_request_uri_);
1564
1565
}
1565
1566
}
Original file line number Diff line number Diff line change @@ -232,15 +232,15 @@ class uri_t {
232
232
std::string port_str;
233
233
if (is_ssl) {
234
234
if (port.empty ()) {
235
- port_str = " https " ;
235
+ port_str = " 443 " ;
236
236
}
237
237
else {
238
238
port_str = std::string (port);
239
239
}
240
240
}
241
241
else {
242
242
if (port.empty ()) {
243
- port_str = " http " ;
243
+ port_str = " 80 " ;
244
244
}
245
245
else {
246
246
port_str = std::string (port);
Original file line number Diff line number Diff line change 5
5
// CINATRA_VERSION % 100 is the sub-minor version
6
6
// CINATRA_VERSION / 100 % 1000 is the minor version
7
7
// CINATRA_VERSION / 100000 is the major version
8
- #define CINATRA_VERSION 901 // 0.9.1
8
+ #define CINATRA_VERSION 902 // 0.9.2
Original file line number Diff line number Diff line change @@ -252,7 +252,7 @@ async_simple::coro::Lazy<void> test_async_client() {
252
252
// 通过重连复用client1
253
253
r = async_simple::coro::syncAwait(client1.connect("http://cn.bing.com "));
254
254
CHECK(client1.get_host() == "cn.bing.com");
255
- CHECK(client1.get_port() == "http ");
255
+ CHECK(client1.get_port() == "80 ");
256
256
CHECK(r.status == 200);
257
257
```
258
258
Original file line number Diff line number Diff line change @@ -753,7 +753,7 @@ TEST_CASE("test coro_http_client async_http_connect") {
753
753
754
754
r = async_simple::coro::syncAwait (client1.connect (" http://cn.bing.com" ));
755
755
CHECK (client1.get_host () == " cn.bing.com" );
756
- CHECK (client1.get_port () == " http " );
756
+ CHECK (client1.get_port () == " 80 " );
757
757
CHECK (r.status >= 200 );
758
758
759
759
r = async_simple::coro::syncAwait (client1.connect (" http://www.baidu.com" ));
You can’t perform that action at this time.
0 commit comments