Calling client.asSecondaryAuthUser from a client scoped to a fake request returns the following error:
Error: asSecondaryAuthUser called from a client scoped to a request without 'authorization' header.
The issue appears to be in this ternary that extracts auth headers from the request. When provided a fake request, isRealRequest(request) will return true triggering the wrong branch, leading to empty headers while request.headers are set.
Calling
client.asSecondaryAuthUser
from a client scoped to a fake request returns the following error:Error: asSecondaryAuthUser called from a client scoped to a request without 'authorization' header.
The issue appears to be in this ternary that extracts auth headers from the request. When provided a fake request,
isRealRequest(request)
will return true triggering the wrong branch, leading to empty headers whilerequest.headers
are set.How to reproduce: