Azure / azure-functions-nodejs-library

The Node.js framework for Azure Functions
https://www.npmjs.com/package/@azure/functions
MIT License
59 stars 11 forks source link

Bearer authorization token is being trucanted. #251

Closed exhaler closed 4 months ago

exhaler commented 4 months ago

Repro steps

Provide the steps required to reproduce the problem:

Github repo: https://github.com/exhaler/DebugSample

  1. Create a function app in VS Code
  2. Log this request.headers.get("authorization");
  3. Push the changes to the static web app and wait until it deploys.
  4. Check the logs to see that authorization is truncated to 365 chars.
  5. This only happens live and never while locally testing.

Expected behavior

To get the full authorization string being sent Bearer eyJhbGciOiJSUzI1NiIsImtpZ....

Actual behavior

Authorization header is being truncated to 365 characters, full sample:

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYmYiOjE3MTQwMDExNjgsImV4cCI6MTcxNDAwMTQ2OCwiaWF0IjoxNzE0MDAxMTY4LCJpc3MiOiJodHRwczovLzI5NjUwNWM5LTU1OTMtNDE0MC1iNDNkLWE0NmQyMWUyMjNiZS5zY20uYXp1cmV3ZWJzaXRlcy5uZXQiLCJhdWQiOiJodHRwczovLzI5NjUwNWM5LTU1OTMtNDE0MC1iNDNkLWE0NmQyMWUyMjNiZS5henVyZXdlYnNpdGVzLm5ldC9henVyZWZ1bmN0aW9ucyJ9.PudR8AmjfUDRspT_x1_yCWS8e22l1PJ3mEIgYUOIuBY

Known workarounds

Sending the token using a custom header, example X-Auth-Token, works fine and is not truncated.

Related information

ejizba commented 4 months ago

Hi @exhaler this appears to be specific to static web apps. I tried with a standalone function app and wasn't seeing any problems. I believe this is actually related to https://github.com/Azure/static-web-apps/issues/34

ejizba commented 4 months ago

Closing in favor of static web apps bug