mirror of
https://github.com/fullstack-cash/bch-api.git
synced 2026-09-22 09:12:05 -07:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2817300ad6 | ||
|
|
4aa7cad552 | ||
|
|
5a9401aeb1 | ||
|
|
0ae02790a2 |
@@ -12,6 +12,8 @@
|
||||
// req.locals.jwtToken property.
|
||||
const getTokenFromHeaders = (req, res, next) => {
|
||||
try {
|
||||
// console.log('req.headers: ', req.headers)
|
||||
|
||||
// Only executes if the authorization header exists.
|
||||
if (req.headers.authorization) {
|
||||
// Retrieve the auth string from the header object.
|
||||
@@ -21,7 +23,7 @@ const getTokenFromHeaders = (req, res, next) => {
|
||||
if (authStr.split(' ')[0] === 'Token') {
|
||||
const token = authStr.split(' ')[1]
|
||||
|
||||
console.log(`JWT found: ${token}`)
|
||||
// console.log(`JWT found: ${token}`)
|
||||
|
||||
// Create the req.locals property if it does not yet exist.
|
||||
if (!req.locals) {
|
||||
|
||||
@@ -270,9 +270,9 @@ class RateLimits {
|
||||
res.locals.rateLimitTriggered = true
|
||||
// console.log('res.locals: ', res.locals)
|
||||
|
||||
console.log(
|
||||
`rate limit debug info: ${JSON.stringify(debugInfo, null, 2)}`
|
||||
)
|
||||
// console.log(
|
||||
// `rate limit debug info: ${JSON.stringify(debugInfo, null, 2)}`
|
||||
// )
|
||||
|
||||
// Rate limited was triggered
|
||||
res.status(429) // https://github.com/Bitcoin-com/rest.bitcoin.com/issues/330
|
||||
|
||||
Reference in New Issue
Block a user