| 200 | }); |
| 201 | |
| 202 | async function post(p, body) { |
| 203 | const res = await fetch(`${proxyUrl}${p}`, { |
| 204 | method: 'POST', |
| 205 | headers: { |
| 206 | 'Content-Type': 'application/json', |
| 207 | 'Authorization': `Bearer ${proxy.server.token}`, |
| 208 | }, |
| 209 | body: JSON.stringify(body), |
| 210 | }); |
| 211 | return { status: res.status, body: await res.json() }; |
| 212 | } |
| 213 | |
| 214 | it('POST /asset/fetch with a single bare asset_id passes hub protocol validation', async () => { |
| 215 | const res = await post('/asset/fetch', { asset_ids: ['sha256:single'] }); |