Skip to content

Commit

Permalink
[fix] use HTTP Header Get function to replace directly map operation
Browse files Browse the repository at this point in the history
  • Loading branch information
shabicheng committed Apr 9, 2021
1 parent 595f0c4 commit 333bfaa
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions log_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ func (s *LogStore) GetHistograms(topic string, from int64, to int64, queryExp st
return nil, NewBadResponseError(string(body), r.Header, r.StatusCode)
}

count, err := strconv.ParseInt(r.Header[GetLogsCountHeader][0], 10, 64)
count, err := strconv.ParseInt(r.Header.Get(GetLogsCountHeader), 10, 64)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -553,7 +553,7 @@ func (s *LogStore) getLogs(topic string, from int64, to int64, queryExp string,
return nil, nil, nil, err
}

count, err := strconv.ParseInt(r.Header[GetLogsCountHeader][0], 10, 32)
count, err := strconv.ParseInt(r.Header.Get(GetLogsCountHeader), 10, 32)
if err != nil {
return nil, nil, nil, err
}
Expand All @@ -564,7 +564,7 @@ func (s *LogStore) getLogs(topic string, from int64, to int64, queryExp string,
}
}
hasSQL := false
if sqlHeaderArray, ok := r.Header[HasSQLHeader]; ok && len(sqlHeaderArray) > 0 && sqlHeaderArray[0] == "true" {
if r.Header.Get(HasSQLHeader) == "true" {
hasSQL = true
}

Expand Down

0 comments on commit 333bfaa

Please sign in to comment.