Skip to content

Commit

Permalink
update method signature
Browse files Browse the repository at this point in the history
  • Loading branch information
jeevatkm committed May 9, 2018
1 parent 8907328 commit cb102f7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,9 @@ func (e *Engine) OnError(ecf EventCallbackFunc) {
// Along with Check Origin, aah WebSocket events such as `OnPreConnect`,
// `OnPostConnect`, `OnPostDisconnect` and `OnError`.
func (e *Engine) Handle(w http.ResponseWriter, r *http.Request) {
domain := e.router.Lookup(ahttp.IdentifyHost(r))
domain := e.router.Lookup(ahttp.Host(r))
if domain == nil {
e.Log().Errorf("WS: domain not found: %s", ahttp.IdentifyHost(r))
e.Log().Errorf("WS: domain not found: %s", ahttp.Host(r))
e.replyError(w, http.StatusNotFound)
return
}
Expand Down Expand Up @@ -232,7 +232,7 @@ func (e *Engine) newContext(r *http.Request, route *router.Route, pathParams aht
route: route,
Req: &Request{
ID: ess.NewGUID(),
Host: ahttp.IdentifyHost(r),
Host: ahttp.Host(r),
Path: r.URL.Path,
Header: r.Header,
pathParams: pathParams,
Expand Down
2 changes: 1 addition & 1 deletion engine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func TestEngineWSClient(t *testing.T) {

ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
if r.Header.Get(ahttp.HeaderOrigin) == "" {
r.Header.Set(ahttp.HeaderOrigin, fmt.Sprintf("http://%s", ahttp.IdentifyHost(r)))
r.Header.Set(ahttp.HeaderOrigin, fmt.Sprintf("http://%s", ahttp.Host(r)))
}
wse.Handle(w, r)
}))
Expand Down

0 comments on commit cb102f7

Please sign in to comment.