# Instructions

- Following Playwright test failed.
- Explain why, be concise, respect Playwright best practices.
- Provide a snippet of code with the fix, if possible.

# Test info

- Name: tests/ui/asset-proxy.spec.ts >> s3proxy-backed locations >> only GET and HEAD reach the buckets
- Location: tests/ui/asset-proxy.spec.ts:14:7

# Error details

```
Error: apiRequestContext.fetch: connect ECONNREFUSED 10.1.105.22:80
Call log:
  - → DELETE http://10.1.105.22/images/__method-probe-does-not-exist.svg
    - user-agent: Playwright/1.64.1 (x64; ubuntu 22.04) node/20.9 CI/1
    - accept: */*
    - accept-encoding: gzip,deflate,br

```

# Test source

```ts
  1  | import { test, expect } from '@playwright/test';
  2  | 
  3  | /*
  4  |  * /images/, /geo/ and the collection sitemaps are proxied to s3proxy buckets (nginx.conf). Only reads may pass
  5  |  * (electinfo/sites#497): no other method, and no decoded ?, #, % or whitespace in the object path, which the variable
  6  |  * proxy_pass would send unescaped (an S3 query such as ?list-type=2, or a second decoding upstream). On the front door
  7  |  * Traefik already answers 400 for most encoded forms; nginx answers 404. The method check uses a key that does not
  8  |  * exist and never sends PUT, so a regression cannot write anything.
  9  |  */
  10 | 
  11 | const PROBE = '/images/__method-probe-does-not-exist.svg';
  12 | 
  13 | test.describe('s3proxy-backed locations', () => {
  14 |   test('only GET and HEAD reach the buckets', async ({ request }) => {
  15 |     for (const path of [PROBE, '/candidates/sitemap-candidates.xml']) {
  16 |       for (const method of ['DELETE', 'POST', 'PATCH']) {
> 17 |         const status = (await request.fetch(path, { method, maxRedirects: 0 })).status();
     |                                       ^ Error: apiRequestContext.fetch: connect ECONNREFUSED 10.1.105.22:80
  18 |         expect([403, 404, 405], `${method} ${path}: ${status}`).toContain(status);
  19 |       }
  20 |     }
  21 |   });
  22 | 
  23 |   test('encoded query, fragment and percent never reach the bucket', async ({ request }) => {
  24 |     for (const path of [
  25 |       '/images/%3Flist-type=2',
  26 |       '/geo/%3Fpolicy',
  27 |       '/images/%3Fuploads',
  28 |       '/images/x%23y.svg',
  29 |       '/images/%252e%252e/geo/blocks/x.geojson',
  30 |     ]) {
  31 |       const status = (await request.get(path, { maxRedirects: 0 })).status();
  32 |       expect([400, 404], `${path}: ${status}`).toContain(status);
  33 |     }
  34 |   });
  35 | });
  36 | 
```