Skip to content

Commit

Permalink
Merge pull request #14 from krakend/fix_bad_interface_conversion
Browse files Browse the repository at this point in the history
Fix bad interface conversion
  • Loading branch information
kpacha authored Apr 16, 2024
2 parents 306bbfc + 9c851bb commit fcdfcc0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions http/server/response_writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,14 @@ func (w *TrackingResponseWriter) Flush() {
func newTrackingResponseWriter(rw http.ResponseWriter, t *tracking, recordHeaders bool,
hijackCallback func(net.Conn, error) (net.Conn, error),
) *TrackingResponseWriter {
flusher, _ := rw.(http.Flusher)
hijacker, _ := rw.(http.Hijacker)
return &TrackingResponseWriter{
track: t,
recordHeaders: recordHeaders,
rw: rw,
flusher: rw.(http.Flusher),
hijacker: rw.(http.Hijacker),
flusher: flusher,
hijacker: hijacker,
hijackCallback: hijackCallback,
}
}
3 changes: 2 additions & 1 deletion http/server/tracking.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ func newTracking() *tracking {
func fromContext(ctx context.Context) *tracking {
v := ctx.Value(krakenDContextTrackingStrKey)
if v != nil {
return v.(*tracking)
t, _ := v.(*tracking)
return t
}
return nil
}
Expand Down

0 comments on commit fcdfcc0

Please sign in to comment.