diff --git a/README.md b/README.md index 29ad3ee..dc7ef40 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ import ( "github.com/aws/aws-sdk-go/service/apigatewaymanagementapi" "github.com/aws/aws-sdk-go/service/apigatewaymanagementapi/apigatewaymanagementapiiface" - awswebsocketadapter "github.com/armsnyder/aws-websocket-adapter" + "github.com/armsnyder/awswebsocketadapter" ) func main() { diff --git a/adapter.go b/adapter.go index 2b44fd2..c671d34 100644 --- a/adapter.go +++ b/adapter.go @@ -44,6 +44,9 @@ type Adapter struct { // ServeHTTP upgrades the request from HTTP to WS and then continues to send and receive websocket // messages over the connection. func (a *Adapter) ServeHTTP(w http.ResponseWriter, r *http.Request) { + // Disable origin checking. + a.upgrader.CheckOrigin = func(_ *http.Request) bool { return true } + // Upgrade the HTTP request to WS. ws, err := a.upgrader.Upgrade(w, r, nil) if err != nil { diff --git a/example_test.go b/example_test.go index 4565ade..18cfb7e 100644 --- a/example_test.go +++ b/example_test.go @@ -9,7 +9,7 @@ import ( "github.com/aws/aws-sdk-go/service/apigatewaymanagementapi" "github.com/aws/aws-sdk-go/service/apigatewaymanagementapi/apigatewaymanagementapiiface" - awswebsocketadapter "github.com/armsnyder/aws-websocket-adapter" + "github.com/armsnyder/awswebsocketadapter" ) func Example() { diff --git a/go.mod b/go.mod index c7587eb..8fd483a 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/armsnyder/aws-websocket-adapter +module github.com/armsnyder/awswebsocketadapter go 1.15