mirror of
https://github.com/bettercap/bettercap
synced 2025-07-06 13:02:12 -07:00
refact: returning pointers for both js request and js response
This commit is contained in:
parent
291b95b5f7
commit
cb58258bd7
3 changed files with 5 additions and 5 deletions
|
@ -27,7 +27,7 @@ type JSRequest struct {
|
|||
req *http.Request
|
||||
}
|
||||
|
||||
func NewJSRequest(req *http.Request) JSRequest {
|
||||
func NewJSRequest(req *http.Request) *JSRequest {
|
||||
headers := make([]JSHeader, 0)
|
||||
cType := ""
|
||||
|
||||
|
@ -41,7 +41,7 @@ func NewJSRequest(req *http.Request) JSRequest {
|
|||
}
|
||||
}
|
||||
|
||||
return JSRequest{
|
||||
return &JSRequest{
|
||||
Client: strings.Split(req.RemoteAddr, ":")[0],
|
||||
Method: req.Method,
|
||||
Version: fmt.Sprintf("%d.%d", req.ProtoMajor, req.ProtoMinor),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue