Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions baskets.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ type RequestData struct {
Method string `json:"method"`
Path string `json:"path"`
Query string `json:"query"`
RemoteAddr string `json:"remote_addr"`
}

// RequestsPage describes a page with collected requests.
Expand Down Expand Up @@ -141,6 +142,7 @@ func ToRequestData(req *http.Request) *RequestData {
data.Method = req.Method
data.Path = req.URL.Path
data.Query = req.URL.RawQuery
data.RemoteAddr = strings.Split(req.RemoteAddr, ":")[0]

body, _ := ioutil.ReadAll(req.Body)
data.Body = string(body)
Expand Down
1 change: 1 addition & 0 deletions web/basket.html
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@
var html = '<div class="row"><div class="col-md-2"><h4 class="text-' + headerClass + '">[' + request.method + ']</h4>' +
'<div><i class="glyphicon glyphicon-time" title="' + date.toString() + '"></i> ' + date.toLocaleTimeString() +
'</div><div><i class="glyphicon glyphicon-calendar" title="' + date.toString() + '"></i> ' + date.toLocaleDateString() +
'</div><div><i class="glyphicon glyphicon-user" title="' + request.remote_addr + '"></i> ' + request.remote_addr +
'</div></div><div class="col-md-10"><div class="panel-group" id="' + id + '">' +
'<div class="panel panel-' + headerClass + '"><div class="panel-heading"><h4 class="panel-title">' + escapeHTML(path) +
'<span id="' + id + '_copy_request_btn" for="' + requestId + '" class="pull-right copy-req-btn">' +
Expand Down
1 change: 1 addition & 0 deletions web_basket.html.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ const (
var html = '<div class="row"><div class="col-md-2"><h4 class="text-' + headerClass + '">[' + request.method + ']</h4>' +
'<div><i class="glyphicon glyphicon-time" title="' + date.toString() + '"></i> ' + date.toLocaleTimeString() +
'</div><div><i class="glyphicon glyphicon-calendar" title="' + date.toString() + '"></i> ' + date.toLocaleDateString() +
'</div><div><i class="glyphicon glyphicon-user" title="' + request.remote_addr + '"></i> ' + request.remote_addr +
'</div></div><div class="col-md-10"><div class="panel-group" id="' + id + '">' +
'<div class="panel panel-' + headerClass + '"><div class="panel-heading"><h4 class="panel-title">' + escapeHTML(path) +
'<span id="' + id + '_copy_request_btn" for="' + requestId + '" class="pull-right copy-req-btn">' +
Expand Down