@@ -20,10 +20,12 @@ class HTTPWasmClient : public HTTPClient {
20
20
21
21
unique_ptr<HTTPResponse> Get (GetRequestInfo &info) override {
22
22
// clang-format off
23
+
23
24
unique_ptr<HTTPResponse> res;
24
25
25
- string path = host_port + info.url ;
26
- path = info.url ;
26
+ string path = info.url ;
27
+ if (path[0 ] == ' /' ) path = host_port + info.url ;
28
+
27
29
if (!web::experimental_s3_tables_global_proxy.empty ()) {
28
30
if (info.url .rfind (web::experimental_s3_tables_global_proxy, 0 ) != 0 ) {
29
31
auto id_table = path.find (" --table-s3.s3." );
@@ -165,8 +167,9 @@ class HTTPWasmClient : public HTTPClient {
165
167
unique_ptr<HTTPResponse> Head (HeadRequestInfo &info) override {
166
168
unique_ptr<HTTPResponse> res;
167
169
168
- string path = host_port + info.url ;
169
- path = info.url ;
170
+ string path = info.url ;
171
+ if (path[0 ] == ' /' ) path = host_port + info.url ;
172
+
170
173
if (!web::experimental_s3_tables_global_proxy.empty ()) {
171
174
if (info.url .rfind (web::experimental_s3_tables_global_proxy, 0 ) != 0 ) {
172
175
auto id_table = path.find (" --table-s3.s3." );
@@ -405,8 +408,9 @@ res->headers.Insert(head, tail);
405
408
unique_ptr<HTTPResponse> Post (PostRequestInfo &info) override {
406
409
unique_ptr<HTTPResponse> res;
407
410
408
- string path = host_port + info.url ;
409
- path = info.url ;
411
+ string path = info.url ;
412
+ if (path[0 ] == ' /' ) path = host_port + info.url ;
413
+
410
414
if (!web::experimental_s3_tables_global_proxy.empty ()) {
411
415
if (info.url .rfind (web::experimental_s3_tables_global_proxy, 0 ) != 0 ) {
412
416
auto id_table = path.find (" --table-s3.s3." );
@@ -559,8 +563,9 @@ res->headers.Insert(head, tail);
559
563
unique_ptr<HTTPResponse> Put (PutRequestInfo &info) override {
560
564
unique_ptr<HTTPResponse> res;
561
565
562
- string path = host_port + info.url ;
563
- path = info.url ;
566
+ string path = info.url ;
567
+ if (path[0 ] == ' /' ) path = host_port + info.url ;
568
+
564
569
if (!web::experimental_s3_tables_global_proxy.empty ()) {
565
570
if (info.url .rfind (web::experimental_s3_tables_global_proxy, 0 ) != 0 ) {
566
571
auto id_table = path.find (" --table-s3.s3." );
@@ -713,8 +718,8 @@ res->headers.Insert(head, tail);
713
718
unique_ptr<HTTPResponse> Delete (DeleteRequestInfo &info) override {
714
719
unique_ptr<HTTPResponse> res;
715
720
716
- string path = host_port + info.url ;
717
- path = info.url ;
721
+ string path = info.url ;
722
+ if ( path[ 0 ] == ' / ' ) path = host_port + info.url ;
718
723
719
724
if (!web::experimental_s3_tables_global_proxy.empty ()) {
720
725
if (info.url .rfind (web::experimental_s3_tables_global_proxy, 0 ) != 0 ) {
0 commit comments