refact: returning pointers for both js request and js response

This commit is contained in:
evilsocket 2018-03-05 16:14:26 +01:00
parent 291b95b5f7
commit cb58258bd7
3 changed files with 5 additions and 5 deletions

View file

@ -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),