(request: RequestLike)
| 159 | } |
| 160 | |
| 161 | async match(request: RequestLike): Promise<Response | undefined> { |
| 162 | const url = this.normalizeRequest(request); |
| 163 | const hash = await this.resolveHashDescriptor(url); |
| 164 | if (!hash) { |
| 165 | return undefined; |
| 166 | } |
| 167 | try { |
| 168 | const api = this.getApi(); |
| 169 | if (!api) { |
| 170 | return undefined; |
| 171 | } |
| 172 | const handle = await api.requestFileHandle(hash); |
| 173 | if (!handle) { |
| 174 | return undefined; |
| 175 | } |
| 176 | const blob = await handle.getFile(); |
| 177 | return new Response(blob); |
| 178 | } catch { |
| 179 | return undefined; |
| 180 | } |
| 181 | } |
| 182 | |
| 183 | async put(request: RequestLike, response: Response): Promise<void> { |
| 184 | const url = this.normalizeRequest(request); |
no test coverage detected