File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
scaleway-core/scaleway_core Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -118,7 +118,6 @@ def _request(
118
118
body : Optional [Body ] = None ,
119
119
) -> requests .Response :
120
120
additional_headers : Dict [str , str ] = {}
121
-
122
121
method = method .upper ()
123
122
if method == "POST" or method == "PUT" or method == "PATCH" :
124
123
additional_headers ["Content-Type" ] = "application/json; charset=utf-8"
@@ -146,7 +145,6 @@ def _request(
146
145
** additional_headers ,
147
146
** headers ,
148
147
}
149
-
150
148
url = f"{ self .client .api_url } { path } "
151
149
152
150
logger = APILogger (self ._log , self .client ._increment_request_count ())
@@ -168,6 +166,12 @@ def _request(
168
166
verify = not self .client .api_allow_insecure ,
169
167
)
170
168
169
+ if response .headers .get ("x-total-count" ):
170
+ b = response .json ()
171
+ b ["total_count" ] = response .headers .get ("x-total-count" )
172
+ b = json .dumps (b )
173
+ response ._content = bytes (b , "utf-8" )
174
+
171
175
logger .log_response (
172
176
response = response ,
173
177
)
You can’t perform that action at this time.
0 commit comments