pixtron / bybit-api

An unofficial node.js lowlevel wrapper for the Bybit Cryptocurrency Derivative exchange API
MIT License
21 stars 16 forks source link

Joined url has double-slash - testnet errors #13

Closed tiagosiebler closed 3 years ago

tiagosiebler commented 4 years ago

All URLs joined in the request._call() method have a double-slash, testnet & livenet. In testnet this causes 404 errors, I'm surprised there are no errors from this in livenet too:

bybit._call():  {
  url: 'https://api.bybit.com//v2/public/time',
  method: 'GET',
  json: true
}

I've only started noticing this recently with testnet - perhaps bybit changed their testnet backend a bit to reject that. Same call on testnet:

bybit._call():  {
  url: 'https://api-testnet.bybit.com//v2/public/time',
  method: 'GET',
  json: true
}

In testnet, this is treated as a 404 error (you can try it in your browser too). Logged #12 on how this is handled, though the double slash should be fixed too.