( req: http.IncomingMessage, res: http.ServerResponse, authorize: AuxiliaryHttpAuthorizer, )
| 92 | } |
| 93 | |
| 94 | async function handleUpload( |
| 95 | req: http.IncomingMessage, |
| 96 | res: http.ServerResponse, |
| 97 | authorize: AuxiliaryHttpAuthorizer, |
| 98 | ): Promise<void> { |
| 99 | try { |
| 100 | const auth = await authorize({ |
| 101 | req, |
| 102 | res, |
| 103 | daemonRequest: { |
| 104 | command: 'upload', |
| 105 | positionals: [], |
| 106 | }, |
| 107 | }); |
| 108 | if (!auth) return; |
| 109 | |
| 110 | sendUploadedArtifactResponse(res, await receiveUpload(req), auth.tenantId); |
| 111 | } catch (error) { |
| 112 | sendRestJsonError(res, normalizeError(error)); |
| 113 | } |
| 114 | } |
| 115 | |
| 116 | async function handleUploadPreflight( |
| 117 | req: http.IncomingMessage, |
no test coverage detected