Skip to content

Commit 9e882bb

Browse files
authored
feat: do not fail on 10MB Ogmios responses (#865)
* feat: do not fail on 10MB Ogmios responses * make the limit 250MB
1 parent 953331f commit 9e882bb

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

toolkit/utils/ogmios-client/src/jsonrpsee.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ pub enum OgmiosClients {
4646
pub async fn client_for_url(addr: &str, timeout: Duration) -> Result<OgmiosClients, String> {
4747
if addr.starts_with("http") || addr.starts_with("https") {
4848
let client = HttpClientBuilder::default()
49+
.max_response_size(250 * 1024 * 1024)
4950
.request_timeout(timeout)
5051
.build(addr)
5152
.map_err(|e| format!("Couldn't create HTTP client: {}", e))?;
@@ -61,6 +62,7 @@ pub async fn client_for_url(addr: &str, timeout: Duration) -> Result<OgmiosClien
6162
Ok(http_client)
6263
} else if addr.starts_with("ws") || addr.starts_with("wss") {
6364
let client = WsClientBuilder::default()
65+
.max_response_size(250 * 1024 * 1024)
6466
.request_timeout(timeout)
6567
.build(addr.to_owned())
6668
.await

0 commit comments

Comments
 (0)