We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4a7e898 commit 5462123Copy full SHA for 5462123
server/src/actors/upstream.rs
@@ -166,6 +166,8 @@ impl UpstreamRelay {
166
167
let (json, signature) = credentials.secret_key.pack(query);
168
169
+ let max_response_size = self.config.max_api_payload_size();
170
+
171
let future = self
172
.send_request(method, path, |builder| {
173
builder
@@ -174,7 +176,11 @@ impl UpstreamRelay {
174
176
.header(header::CONTENT_TYPE, "application/json")
175
177
.body(json)
178
})
- .and_then(|r| r.json().map_err(UpstreamRequestError::InvalidJson));
179
+ .and_then(move |r| {
180
+ r.json()
181
+ .limit(max_response_size)
182
+ .map_err(UpstreamRequestError::InvalidJson)
183
+ });
184
185
Box::new(future)
186
}
0 commit comments