hyperledger-firefly / hyperledger-firefly/firefly
When using an address resolver, any HTTP error status codes are converted to `500`.
- Dominant language
- Go
- Stars
- 602
- Forks
- 246
- Avg merge
- 18h 47m
- Merged PRs (30d)
- 6
Description
When using an address resolver, any HTTP error status codes are converted to `500`.
Steps to reproduce
- configure an address resolver for the blockchain plugin to point at an endpoint that will return a non 200 status code
e.g....
```yaml
blockchain:
- name: blockchain0
type: ethereum
ethereum:
addressResolver:
urlTemplate: "https://httpbin.org/status/403"
ethconnect:
url: http://evmconnect_0:5008
topic: "0"
```
- deploy a contract and create an API
- invoke the api, passing any string as the `key` property in the JSON payload.
e.g.
```
curl -i -X 'POST' \
'http://127.0.0.1:5000/api/v1/namespaces/default/apis/simple_storage/invoke/get' \
-H 'accept: application/json' \
-H 'Request-Timeout: 2m0s' \
-H 'Content-Type: application/json' \
-d '{
"input": {},
"options": {},
"key": "foo"
}'
```
You will see that the response code is always `500` but the body of the response mentions the response code from the address resolver...
```
HTTP/1.1 500 Internal Server Error
Content-Type: application/json
Vary: Origin
Date: Mon, 30 Jan 2023 18:53:41 GMT
Content-Length: 76
{"error":"FF10340: Failed to resolve signing key string 'foo' [403]: null"}
```
Expected behaviour is for the HTTP status code from firefly to be the same as that from the address resolver.
Contributor guide
Assessment
This issue has not been assessed yet.