Repository: prometheus/prometheus (language: go)

Issue:
Quality values in Accept header in 2.48.0 are wrong
### What did you do?

After updating Prometheus to 2.48.0, Spring Boot Actuator metrics are no longer being collected.

### What did you expect to see?

It should also work correctly with 2.48.0.

### What did you see instead? Under which circumstances?

Before 2.47.2, the following Accept headers were sent
```
application/openmetrics-text;version=1.0.0,application/openmetrics-text;version=0.0.1;q=0.75,text/plain;version=0.0.4;q=0.5,*/*;q=0.1
```
In 2.48.0, the following Accept header is sent, but `*/*;q=2` is incorrect, resulting in an error in Spring Boot.
```
application/openmetrics-text;version=1.0.0;q=0.5,application/openmetrics-text;version=0.0.1;q=0.4,text/plain;version=0.0.4;q=0.3,*/*;q=2
```

Quality Values is incorrect because it ranges from 0 through 1.
https://www.rfc-editor.org/rfc/rfc9110.html#name-quality-values

### System information

Linux 5.15.133.1-microsoft-standard-WSL2 x86_64

### Prometheus version

```text
prometheus, version 2.48.0 (branch: main, revision: e4ec263bcc11493953c75d1b2e7bc78fd0463e05)
  build user:       root@aad5af94daee
  build date:       20231201-22:28:13
  go version:       go1.21.4
  platform:         linux/amd64
  tags:             netgo,builtinassets,stringlabels
```


### Prometheus configuration file

_No response_

### Alertmanager version

_No response_

### Alertmanager configuration file

_No response_

### Logs

_No response_


Discussion / hints:
Ref. #12738
Same problem in 2.49.0-rc.0.
Spring boot produces an `InvalidMediaTypeException` when it sees `q=2`, with the error:

```
 org.springframework.http.InvalidMediaTypeException: Invalid media type "*/*;q=2": Invalid quality value "2": should be between 0.0 and 1.0
	at org.springframework.http.MediaType.parseMediaType(MediaType.java:640) ~[spring-web-5.3.27.jar:5.3.27]
	at org.springframework.http.MediaType.parseMediaTypes(MediaType.java:660) ~[spring-web-5.3.27.jar:5.3.27]
	at org.springframework.http.MediaType.parseMediaTypes(MediaType.java:680) ~[spring-web-5.3.27.jar:5.3.27]
	at org.springframework.http.HttpHeaders.getAccept(HttpHeaders.java:472) ~[spring-web-5.3.27.jar:5.3.27]
	at org.springframework.http.ReadOnlyHttpHeaders.getAccept(ReadOnlyHttpHeaders.java:72) ~[spring-web-5.3.27.jar:5.3.27]
```

@yu-shiba did you find a workaround for this?
To work around this in Spring Boot: https://stackoverflow.com/a/77687013/430128.
I am working on fixing this issue.

Fix patch:
diff --git a/scrape/scrape.go b/scrape/scrape.go
index be27a5d4874..cb65053bad1 100644
--- a/scrape/scrape.go
+++ b/scrape/scrape.go
@@ -675,7 +675,7 @@ func acceptHeader(sps []config.ScrapeProtocol) string {
 		weight--
 	}
 	// Default match anything.
-	vals = append(vals, fmt.Sprintf("*/*;q=%d", weight))
+	vals = append(vals, fmt.Sprintf("*/*;q=0.%d", weight))
 	return strings.Join(vals, ",")
 }
 


Test patch: