Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid HTTP requests to WabiSabiClientLibrary are not handled correctly #21

Open
M1nd3r opened this issue Oct 10, 2023 · 0 comments
Open
Labels
bug Something isn't working

Comments

@M1nd3r
Copy link

M1nd3r commented Oct 10, 2023

General Description

Invalid HTTP requests to WabiSabiClientLibrary are not handled correctly - the descriptions of "what is wrong with the request" are not accurate (example 1) and incomplete requests can be viewed as valid (example 2).

Example 1)

The following request (on /get-liquidity-clue)
{
"rawLiquidityClue": {},
"maxSuggestedAmount": 5
}

(curl -X 'POST' \ 'http://localhost:37128/get-liquidity-clue' \ -H 'accept: application/json' \ -H 'Content-Type: application/json-patch+json' \ -d '{ "rawLiquidityClue": {}, "maxSuggestedAmount": 5 }')

gets a response (code 500) with the following description
{ "description": "The MaxSuggestedAmount field is required." }
The description is misleading - the value "maxSuggestedAmount" is provided, but the "rawLiquidityClue" is not.

Example 2)

The following request (on /get-liquidity-clue)
{
"rawLiquidityClue": {},
"maxSuggestedAmount": 5
}
Gets a response (Code 200):
{ "liquidityClue": 5 }
even though the rawLiquidityClue is missing from the request completely.

Wasabi Version

Current Master version (10. 10. 2023)

@M1nd3r M1nd3r changed the title Wrong HTTP error descriptions in WabiSabiClientLibrary Invalid HTTP requests to WabiSabiClientLibrary are not handled correctly Oct 10, 2023
@M1nd3r M1nd3r added the bug Something isn't working label Oct 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant