-
Notifications
You must be signed in to change notification settings - Fork 902
Closed
Labels
Description
Description
The axios library passes multiple Accept Header values like so
curl -H 'Accept: application/json, text/plain, */*' -H 'User-Agent: axios/0.27.2' -H 'Connection: close' IP:PORT
This results in
{
"code": 400,
"message": "BAD_REQUEST: Unsupported endpoint version: v2",
"stacktraces": []
}
Replacing the Accept header with a single value like application/json
, the call will work as intended.
A similar issue is found here #3114
Version
Lighthouse v4.1.0-693886b
Steps to resolve
By overriding the Accept
header, the call will go through successfully
const axios = require('axios');
axios.get('http://IP:PORT/eth/v2/beacon/blocks/finalized', {
headers: {
'Accept': '*/*'
}
})
.then(data => {
console.log('Data:', data);
})
.catch(error => {
console.error('There was a problem with the fetch operation:', error);
});