Open ItayMarder opened 4 years ago
Update: approval was down. Wait for it to be up before continuing to investigate the bug .
@ItayMarder please check on @yonatandt 's comment
Found the cause of the BUG.
Usually when there are no permission, Unauthorized
(or rather Forbidden
) status should be sent.
In this case, a permit can suffice (for external users), but because an AbortWithStatus
is already called in the HandleUserFilePermission
during the download, GIN is not able to override the status code with OK
therefore the requested file is sent back but with a Unauthorized
status
const options = { method: 'get', url: http://drive-rabaz.northeurope.cloudapp.azure.com/api/files/${fileId}?alt=media, headers: { 'Auth-Type: Service', 'Auth-User: s0000001', 'Authorization: Bearer token from spike-get-token' responseType: 'stream', };
return request(options);