Skip to content

Commit

Permalink
Dropped URL#Scheme,URL#Host and added Request#TLS
Browse files Browse the repository at this point in the history
Signed-off-by: Vishal Rana <[email protected]>
  • Loading branch information
vishr committed Feb 23, 2016
1 parent c19442d commit 89551dd
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 18 deletions.
3 changes: 1 addition & 2 deletions engine/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ type (
}

Request interface {
TLS() bool
Host() string
URI() string
URL() URL
Expand Down Expand Up @@ -52,10 +53,8 @@ type (
}

URL interface {
Scheme() string
SetPath(string)
Path() string
Host() string
QueryValue(string) string
Object() interface{}
}
Expand Down
4 changes: 4 additions & 0 deletions engine/fasthttp/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ func NewRequest(c *fasthttp.RequestCtx) *Request {
}
}

func (r *Request) TLS() bool {
return r.context.IsTLS()
}

func (r *Request) Host() string {
return string(r.context.Host())
}
Expand Down
8 changes: 0 additions & 8 deletions engine/fasthttp/url.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,6 @@ type (
}
)

func (u *URL) Scheme() string {
return string(u.url.Scheme())
}

func (u *URL) Host() string {
return string(u.url.Host())
}

func (u *URL) SetPath(path string) {
// return string(u.URI.Path())
}
Expand Down
4 changes: 4 additions & 0 deletions engine/standard/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ func NewRequest(r *http.Request) *Request {
}
}

func (r *Request) TLS() bool {
return r.request.TLS != nil
}

func (r *Request) Host() string {
return r.request.Host
}
Expand Down
8 changes: 0 additions & 8 deletions engine/standard/url.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,6 @@ func (u *URL) URL() *url.URL {
return u.url
}

func (u *URL) Scheme() string {
return u.url.Scheme
}

func (u *URL) Host() string {
return u.url.Host
}

func (u *URL) SetPath(path string) {
u.url.Path = path
}
Expand Down

0 comments on commit 89551dd

Please sign in to comment.