mirror of
https://github.com/distribution/distribution.git
synced 2025-10-24 21:36:04 +00:00
refactor: replace map iteration with maps.Copy/Clone
Signed-off-by: whosehang <whosehang@outlook.com>
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"io"
|
||||
"maps"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"sort"
|
||||
@@ -137,9 +138,7 @@ func (app *testHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
app.responseMap[request.String()] = responses[1:]
|
||||
|
||||
responseHeader := w.Header()
|
||||
for k, v := range response.Headers {
|
||||
responseHeader[k] = v
|
||||
}
|
||||
maps.Copy(responseHeader, response.Headers)
|
||||
|
||||
w.WriteHeader(response.StatusCode)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user