node-service-template icon indicating copy to clipboard operation
node-service-template copied to clipboard

Requesting a healthcheck from browser generates 401 error for favicon

Open terales opened this issue 2 years ago • 2 comments

Hi! Despite having fastify-no-icon registered, the service (run from template without modifications) throws 401 error for /favicon requests:

image
[2023-10-08 22:00:06.536 -0300] INFO: No Authorization was found in request.headers
    reqId: "c86d3c18-c2dc-4f7e-a31b-cc4c1e3ec34a"
    res: {
      "statusCode": 401
    }
    err: {
      "type": "FastifyError",
      "message": "No Authorization was found in request.headers",
      "stack":
          FastifyError: No Authorization was found in request.headers
              at lookupToken (/Users/terales/Documents/GitHub/lokalise-ditto/node_modules/@fastify/jwt/jwt.js:268:13)
              at _Request.requestVerify [as jwtVerify] (/Users/terales/Documents/GitHub/lokalise-ditto/node_modules/@fastify/jwt/jwt.js:479:15)
              at /Users/terales/Documents/GitHub/lokalise-ditto/node_modules/@fastify/jwt/jwt.js:471:31
              at new Promise (<anonymous>)
              at _Request.requestVerify [as jwtVerify] (/Users/terales/Documents/GitHub/lokalise-ditto/node_modules/@fastify/jwt/jwt.js:470:14)
              at Object.<anonymous> (/Users/terales/Documents/GitHub/lokalise-ditto/src/plugins/jwtTokenPlugin.ts:26:10)
              at hookIterator (/Users/terales/Documents/GitHub/lokalise-ditto/node_modules/fastify/lib/hooks.js:409:10)
              at next (/Users/terales/Documents/GitHub/lokalise-ditto/node_modules/fastify/lib/hooks.js:243:18)
              at Object.<anonymous> (/Users/terales/Documents/GitHub/lokalise-ditto/node_modules/@fastify/awilix/lib/fastifyAwilixPlugin.js:25:5)
              at hookIterator (/Users/terales/Documents/GitHub/lokalise-ditto/node_modules/fastify/lib/hooks.js:409:10)
      "code": "FST_JWT_NO_AUTHORIZATION_IN_HEADER",
      "name": "FastifyError",
      "statusCode": 401
    }

terales avatar Oct 09 '23 01:10 terales

@terales thanks, I know why, will fix

kibertoad avatar Oct 09 '23 08:10 kibertoad

Should be fixed in #695

drdaemos avatar Jul 11 '24 11:07 drdaemos