Repository: prometheus/prometheus (language: go)

Issue:
Prometheus returns HTTP 500 "seeker can't seek" error on /favicon.ico
### What did you do?

1. Run Prometheus (I did `docker run -it -p 9090:9090 quay.io/prometheus/prometheus:latest`)
2. Go to http://localhost:9090/favicon.ico

### What did you expect to see?

Prometheus' favicon.

### What did you see instead? Under which circumstances?

A HTTP 500 response with Go's `seeker can't seek` error message.

### System information

Darwin 21.4.0 x86_64

### Prometheus version

```text
prometheus, version 2.35.0 (branch: HEAD, revision: 6656cd29fe6ac92bab91ecec0fe162ef0f187654)
  build user:       root@cf6852b14d68
  build date:       20220421-09:53:42
  go version:       go1.18.1
  platform:         linux/amd64
```

### Prometheus configuration file

_No response_

### Alertmanager version

_No response_

### Alertmanager configuration file

_No response_

### Logs

_None relevant to the issue (not even with `--log.level=debug`)._



Discussion / hints:
This `HTTP 500` on `/favicon.ico` seems to appear only when running Prometheus using docker. I have a `2.35.0` version running as a service and I get `HTTP 200` and the actual image when I'm browsing `/favicon.ico`.
Same issue here
the issue occurred also when using the PromQL editor. The UI cannot get the icon for the editor. There is a `HTTP 500 Internal Server Error` for http://localhost:9090/static/media/codicon.b3726f0165bf67ac6849.ttf.

And yes it's only in Docker. When we are using the binary directly, the issue doesn't happen.

issue wasn't there in 2.34. I'm looking about what changed between 2.34 and 2.35
It's not only in docker, it's when building with promu crossbuild.
that's weird @roidelapluie. I downloaded the last archive and run the binary and I don't see the issue like @fpapadamis said it too.
```
tar xvf prometheus-2.36.1.linux-amd64.tar.gz
cd prometheus-2.36.1.linux-amd64/
./prometheus 
```

then

```
curl 127.0.0.1:9090/favicon.ico
seeker can't seek
```

```bash
tar xvf prometheus-2.36.1.darwin-amd64.tar.gz
cd prometheus-2.36.1.darwin-amd64/
./prometheus
```

```
curl 127.0.0.1:9090/favicon.ico --output favicon.ico
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 15086  100 15086    0     0   983k      0 --:--:-- --:--:-- --:--:-- 4910k
```

no issue in darwin arch.

Perhaps the issue is more on linux actually
My initial thinking: https://github.com/prometheus/common/blob/627089d3a7af73be778847aa577192b937b8d89a/server/static_file_server.go#L21

We need more extensions here. If the extension is not known, go http will seek the file to know the mimetype, which is not possible.
https://github.com/prometheus/common/pull/385
After some testing, I confirm that prometheus/common#385 fixes the issue.
cool, thank you @roidelapluie. I commented the PR in order to add more mimeTypes support.

Fix patch:
diff --git a/go.mod b/go.mod
index 9c0c83bfb0d..f9acfed9c19 100644
--- a/go.mod
+++ b/go.mod
@@ -42,7 +42,7 @@ require (
 	github.com/prometheus/client_golang v1.12.2
 	github.com/prometheus/client_model v0.2.0
 	github.com/prometheus/common v0.34.0
-	github.com/prometheus/common/assets v0.1.0
+	github.com/prometheus/common/assets v0.2.0
 	github.com/prometheus/common/sigv4 v0.1.0
 	github.com/prometheus/exporter-toolkit v0.7.1
 	github.com/scaleway/scaleway-sdk-go v1.0.0-beta.9
diff --git a/go.sum b/go.sum
index f997a5d6b10..957052cb019 100644
--- a/go.sum
+++ b/go.sum
@@ -744,8 +744,8 @@ github.com/prometheus/common v0.29.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+
 github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls=
 github.com/prometheus/common v0.34.0 h1:RBmGO9d/FVjqHT0yUGQwBJhkwKV+wPCn7KGpvfab0uE=
 github.com/prometheus/common v0.34.0/go.mod h1:gB3sOl7P0TvJabZpLY5uQMpUqRCPPCyRLCZYc7JZTNE=
-github.com/prometheus/common/assets v0.1.0 h1:8WlWPDRjbfff4FWCBjaUF0NEIgDD2Mv2anoKfwG+Ums=
-github.com/prometheus/common/assets v0.1.0/go.mod h1:D17UVUE12bHbim7HzwUvtqm6gwBEaDQ0F+hIGbFbccI=
+github.com/prometheus/common/assets v0.2.0 h1:0P5OrzoHrYBOSM1OigWL3mY8ZvV2N4zIE/5AahrSrfM=
+github.com/prometheus/common/assets v0.2.0/go.mod h1:D17UVUE12bHbim7HzwUvtqm6gwBEaDQ0F+hIGbFbccI=
 github.com/prometheus/common/sigv4 v0.1.0 h1:qoVebwtwwEhS85Czm2dSROY5fTo2PAPEVdDeppTwGX4=
 github.com/prometheus/common/sigv4 v0.1.0/go.mod h1:2Jkxxk9yYvCkE5G1sQT7GuEXm57JrvHu9k5YwTjsNtI=
 github.com/prometheus/exporter-toolkit v0.7.1 h1:c6RXaK8xBVercEeUQ4tRNL8UGWzDHfvj9dseo1FcK1Y=


Test patch: