etherspot / etherspot/arka

[BUG] JSON parse error when wrong HTTP method used

Open
#115 0 comments 0 reactions 0 assignees View on GitHub
bug good first issue
Dominant language
TypeScript
Stars
67
Forks
14
PR merge metrics
No merged PRs in 30d

Description

### Describe the bug

When using `/metadata` endpoint using POST,PUT or other than GET request throws a weird JSON parse error
```{
"statusCode": 400,
"error": "Bad Request",
"message": "Unexpected token [ in JSON at position 15"
}
```
### Expected behavior

Should show:
This HTTP method is not supported for this endpoint, please use GET (or POST depending on endpoint)

### Steps to reproduce

Call https://arka.etherspot.io/metadata?apiKey={apikeyhere}&chainId=80002 using POST request

### Additional context

_No response_

### Operating system

macOS

### Arka version or commit hash

1.2.9

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.