Remove "ms" from durations in HTTP response header

This commit is contained in:
Thomas Buckley-Houston 2018-08-02 15:56:25 +08:00
parent 0b68bd493f
commit ec62ceaeac
2 changed files with 4 additions and 4 deletions

View file

@ -214,9 +214,9 @@ func waitForResponse(rawTextRequestID string, w http.ResponseWriter) {
if rawTextRequestResponse, ok = rawTextRequests[rawTextRequestID]; ok {
jsonResponse = unpackResponse(rawTextRequestResponse)
totalTime = getTotalTiming(rawTextRequests[rawTextRequestID+"-start"])
pageLoad = fmt.Sprintf("%dms", jsonResponse.PageloadDuration)
parsing = fmt.Sprintf("%dms", jsonResponse.ParsingDuration)
w.Header().Set("X-Browsh-Duration-Total", totalTime+"ms")
pageLoad = fmt.Sprintf("%d", jsonResponse.PageloadDuration)
parsing = fmt.Sprintf("%d", jsonResponse.ParsingDuration)
w.Header().Set("X-Browsh-Duration-Total", totalTime)
w.Header().Set("X-Browsh-Duration-Pageload", pageLoad)
w.Header().Set("X-Browsh-Duration-Parsing", parsing)
io.WriteString(w, jsonResponse.Text)

View file

@ -1,3 +1,3 @@
package browsh
var browshVersion = "1.4.10"
var browshVersion = "1.4.11"