EUGENIO SOUZA CARVALHO 3 years ago
parent
commit
596ca4111b
1 changed files with 5 additions and 1 deletions
  1. 5 1
      api/debug.go

+ 5 - 1
api/debug.go

@@ -2,6 +2,7 @@ package api
 
 import (
 	"encoding/json"
+	"net/http"
 	"os"
 	"time"
 
@@ -32,6 +33,7 @@ type DebugTaks struct {
 	Stages       []*DebugStage `json:"stages"`
 	CurrentStage *DebugStage   `json:"-"`
 	Debug        *Debugger     `json:"-"`
+	Request      *http.Request `json:"request"`
 }
 
 func NewDebugTaks() *DebugTaks {
@@ -94,7 +96,9 @@ type Debugger struct {
 
 func (debug *Debugger) Handler() func(context.Context) {
 	return func(ctx context.Context) {
-		ctx.Values().Set("#debug", debug.CreateTask())
+		task := debug.CreateTask()
+		task.Request = ctx.Request()
+		ctx.Values().Set("#debug", task)
 		ctx.Next()
 	}
 }