Skip to content

Commit

Permalink
using rfc package
Browse files Browse the repository at this point in the history
  • Loading branch information
rimashah25 committed Jul 5, 2023
1 parent eab4ebe commit d8c9169
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion traffic_monitor/cache/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ func (handler Handler) Handle(id string, rdr io.Reader, format string, reqTime t
if val, ok := miscStats["plugin.system_stats.timestamp_ms"]; ok {
valInt, valErr := strconv.ParseInt(val.(string), 10, 64)
if valErr != nil {
log.Errorf("parse error '%s'", valErr.Error())
log.Errorln("parse error: ", valErr)
result.Error = valErr
handler.resultChan <- result
return
Expand Down
3 changes: 2 additions & 1 deletion traffic_monitor/cache/cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"net/http"
"testing"

"github.com/apache/trafficcontrol/lib/go-rfc"
"github.com/apache/trafficcontrol/lib/go-tc"
"github.com/apache/trafficcontrol/lib/go-util"
"github.com/apache/trafficcontrol/traffic_monitor/poller"
Expand Down Expand Up @@ -108,7 +109,7 @@ func TestParseAndDecode(t *testing.T) {

pl := &poller.HTTPPollCtx{HTTPHeader: http.Header{}}
ctx := interface{}(pl)
ctx.(*poller.HTTPPollCtx).HTTPHeader.Set("Content-Type", "application/json")
ctx.(*poller.HTTPPollCtx).HTTPHeader.Set("Content-Type", rfc.ApplicationJSON)

decoder, err := GetDecoder("stats_over_http")
if err != nil {
Expand Down

0 comments on commit d8c9169

Please sign in to comment.