mirror of
https://github.com/labstack/echo.git
synced 2025-02-03 13:11:39 +02:00
Dropped URL#Scheme,URL#Host and added Request#TLS
Signed-off-by: Vishal Rana <vr@labstack.com>
This commit is contained in:
parent
c19442d023
commit
89551ddfd9
@ -17,6 +17,7 @@ type (
|
|||||||
}
|
}
|
||||||
|
|
||||||
Request interface {
|
Request interface {
|
||||||
|
TLS() bool
|
||||||
Host() string
|
Host() string
|
||||||
URI() string
|
URI() string
|
||||||
URL() URL
|
URL() URL
|
||||||
@ -52,10 +53,8 @@ type (
|
|||||||
}
|
}
|
||||||
|
|
||||||
URL interface {
|
URL interface {
|
||||||
Scheme() string
|
|
||||||
SetPath(string)
|
SetPath(string)
|
||||||
Path() string
|
Path() string
|
||||||
Host() string
|
|
||||||
QueryValue(string) string
|
QueryValue(string) string
|
||||||
Object() interface{}
|
Object() interface{}
|
||||||
}
|
}
|
||||||
|
@ -29,6 +29,10 @@ func NewRequest(c *fasthttp.RequestCtx) *Request {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (r *Request) TLS() bool {
|
||||||
|
return r.context.IsTLS()
|
||||||
|
}
|
||||||
|
|
||||||
func (r *Request) Host() string {
|
func (r *Request) Host() string {
|
||||||
return string(r.context.Host())
|
return string(r.context.Host())
|
||||||
}
|
}
|
||||||
|
@ -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) {
|
func (u *URL) SetPath(path string) {
|
||||||
// return string(u.URI.Path())
|
// return string(u.URI.Path())
|
||||||
}
|
}
|
||||||
|
@ -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 {
|
func (r *Request) Host() string {
|
||||||
return r.request.Host
|
return r.request.Host
|
||||||
}
|
}
|
||||||
|
@ -13,14 +13,6 @@ func (u *URL) URL() *url.URL {
|
|||||||
return u.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) {
|
func (u *URL) SetPath(path string) {
|
||||||
u.url.Path = path
|
u.url.Path = path
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user