1
0
mirror of https://github.com/labstack/echo.git synced 2025-01-26 03:20:08 +02:00

Dropped URL#Scheme,URL#Host and added Request#TLS

Signed-off-by: Vishal Rana <vr@labstack.com>
This commit is contained in:
Vishal Rana 2016-02-22 21:13:08 -08:00
parent c19442d023
commit 89551ddfd9
5 changed files with 9 additions and 18 deletions

View File

@ -17,6 +17,7 @@ type (
}
Request interface {
TLS() bool
Host() string
URI() string
URL() URL
@ -52,10 +53,8 @@ type (
}
URL interface {
Scheme() string
SetPath(string)
Path() string
Host() string
QueryValue(string) string
Object() interface{}
}

View File

@ -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())
}

View File

@ -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())
}

View File

@ -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
}

View File

@ -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
}