From 0792cfaa06b04eec8499a93593c5d98d6f345e73 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Wed, 25 Apr 2018 16:25:41 +0200 Subject: [PATCH] added String() --- http/upgrade/request/public.go | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/http/upgrade/request/public.go b/http/upgrade/request/public.go index 9144a2d..a6f687e 100644 --- a/http/upgrade/request/public.go +++ b/http/upgrade/request/public.go @@ -10,6 +10,8 @@ import ( // from a reader (typically bufio.NewRead of the socket) func Build(r io.Reader) (request *T, err error) { + /* (1) Parse request + ---------------------------------------------------------*/ /* (1) Get chunk reader */ cr := reader.NewReader(r) if err != nil { @@ -40,14 +42,15 @@ func Build(r io.Reader) (request *T, err error) { } - - /* (2) GET {uri} HTTP/{version} - ---------------------------------------------------------*/ - /* (1) Break apart */ - - - - /* (1) Check method */ - return nil, nil + return req, nil } + + + +// String returns a textual representation of the upgrade request +func (r T) String() string{ + + return fmt.Sprintf("Upgrade Request\n - host: %s\n - port: %d\n", r.host, r.port) + +} \ No newline at end of file