Skip to content

Commit 2c31269

Browse files
authored
Merge pull request #127 from ndsev/fix-httplib-interface
Fix httplib API calls for empty body #126
2 parents cf7922a + a657185 commit 2c31269

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

.github/workflows/cmake.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ jobs:
88
matrix:
99
python-version: ["3.8", "3.9", "3.10", "3.11"]
1010
runs-on: ubuntu-latest
11-
container: ghcr.io/klebert-engineering/manylinux-cpp17-py${{ matrix.python-version }}-x86_64:2024.1
11+
container: ghcr.io/klebert-engineering/manylinux-cpp17-py${{ matrix.python-version }}-x86_64:2024.2
1212
env:
1313
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
1414
steps:
1515
- name: Which Node.js?
1616
run: |
1717
echo "Node at $(which node): $(node -v); npm: $(npm -v)"
1818
- name: Checkout code
19-
uses: actions/checkout@v2
19+
uses: actions/checkout@v4
2020
- name: Configure
2121
run: |
2222
python3 -m venv venv && . ./venv/bin/activate
@@ -37,7 +37,7 @@ jobs:
3737
. ../venv/bin/activate
3838
ctest -C Release --verbose --no-tests=error
3939
- name: Deploy
40-
uses: actions/upload-artifact@v2
40+
uses: actions/upload-artifact@v4
4141
with:
4242
name: zswag-py${{ matrix.python-version }}-ubuntu-latest
4343
path: build/bin/wheel/*.whl
@@ -48,7 +48,7 @@ jobs:
4848
os: [macos-13, windows-latest]
4949
python-version: ["3.8", "3.9", "3.10", "3.11"]
5050
steps:
51-
- uses: actions/checkout@v2
51+
- uses: actions/checkout@v4
5252
with:
5353
submodules: recursive
5454
- name: Cache Conan packages
@@ -89,7 +89,7 @@ jobs:
8989
cmake "-DPython3_ROOT_DIR=$env:pythonLocation" -DPython3_FIND_REGISTRY=LAST -DCMAKE_BUILD_TYPE=Release -DZSWAG_ENABLE_TESTING=ON ..
9090
cmake --build . --config Release
9191
- name: Deploy
92-
uses: actions/upload-artifact@v2
92+
uses: actions/upload-artifact@v4
9393
with:
9494
name: zswag-py${{ matrix.python-version }}-${{ matrix.os }}
9595
path: build/bin/wheel/*.whl

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ project(zswag)
2323

2424
set(CMAKE_CXX_STANDARD 17)
2525
set(CMAKE_CXX_STANDARD_REQUIRED ON)
26-
set(ZSWAG_VERSION 1.7.0)
26+
set(ZSWAG_VERSION 1.7.1)
2727

2828
option(ZSWAG_BUILD_WHEELS "Enable zswag whl-output to WHEEL_DEPLOY_DIRECTORY." ON)
2929
option(ZSWAG_KEYCHAIN_SUPPORT "Enable zswag keychain support." ON)

libs/httpcl/src/http-client.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ Result HttpLibHttpClient::get(const std::string& uriStr,
6464
auto uri = URIComponents::fromStrRfc3986(uriStr);
6565
return makeResult(
6666
makeClientAndApplyQuery(uri, config, timeoutSecs_, sslCertStrict_)
67-
->Get(uri.buildPath().c_str()));
67+
->Get(uri.buildPath()));
6868
}
6969

7070
Result HttpLibHttpClient::post(const std::string& uriStr,
@@ -75,9 +75,9 @@ Result HttpLibHttpClient::post(const std::string& uriStr,
7575
return makeResult(
7676
makeClientAndApplyQuery(uri, config, timeoutSecs_, sslCertStrict_)
7777
->Post(
78-
uri.buildPath().c_str(),
78+
uri.buildPath(),
7979
body ? body->body : std::string(),
80-
body ? body->contentType.c_str() : nullptr));
80+
body ? body->contentType : std::string()));
8181
}
8282

8383
Result HttpLibHttpClient::put(const std::string& uriStr,
@@ -88,9 +88,9 @@ Result HttpLibHttpClient::put(const std::string& uriStr,
8888
return makeResult(
8989
makeClientAndApplyQuery(uri, config, timeoutSecs_, sslCertStrict_)
9090
->Put(
91-
uri.buildPath().c_str(),
91+
uri.buildPath(),
9292
body ? body->body : std::string(),
93-
body ? body->contentType.c_str() : nullptr));
93+
body ? body->contentType : std::string()));
9494
}
9595

9696
Result HttpLibHttpClient::del(const std::string& uriStr,
@@ -101,9 +101,9 @@ Result HttpLibHttpClient::del(const std::string& uriStr,
101101
return makeResult(
102102
makeClientAndApplyQuery(uri, config, timeoutSecs_, sslCertStrict_)
103103
->Delete(
104-
uri.buildPath().c_str(),
104+
uri.buildPath(),
105105
body ? body->body : std::string(),
106-
body ? body->contentType.c_str() : nullptr));
106+
body ? body->contentType : std::string()));
107107
}
108108

109109
Result HttpLibHttpClient::patch(const std::string& uriStr,
@@ -114,9 +114,9 @@ Result HttpLibHttpClient::patch(const std::string& uriStr,
114114
return makeResult(
115115
makeClientAndApplyQuery(uri, config, timeoutSecs_, sslCertStrict_)
116116
->Patch(
117-
uri.buildPath().c_str(),
117+
uri.buildPath(),
118118
body ? body->body : std::string(),
119-
body ? body->contentType.c_str() : nullptr));
119+
body ? body->contentType : std::string()));
120120
}
121121

122122
Result MockHttpClient::get(const std::string& uri,

0 commit comments

Comments
 (0)