From 372c4654729c4557784b5908968826cc2dc819d0 Mon Sep 17 00:00:00 2001 From: Noah Metz Date: Thu, 13 Jul 2023 18:23:57 -0600 Subject: [PATCH] gql.go --- gql.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/gql.go b/gql.go index c3dba7d..1e35d33 100644 --- a/gql.go +++ b/gql.go @@ -161,6 +161,7 @@ func GQLHandler(ctx * Context, server * GQLThread) func(http.ResponseWriter, *ht ctx.Log.Logf("gql", "GQL_REQUEST_ERR: no auth header included in request header") return } + ctx.Log.Logf("gql", "GQL_AUTH: %s", auth) str, err := io.ReadAll(r.Body) if err != nil { @@ -253,7 +254,15 @@ func GQLWSHandler(ctx * Context, server * GQLThread) func(http.ResponseWriter, * for header, value := range(r.Header) { header_map[header] = value } + ctx.Log.Logm("gql", header_map, "REQUEST_HEADERS") + auth, ok := checkForAuthHeader(r.Header) + if ok == false { + ctx.Log.Logf("gql", "GQL_REQUEST_ERR: no auth header included in request header") + return + } + ctx.Log.Logf("gql", "GQL_AUTH: %s", auth) + u := ws.HTTPUpgrader{ Protocol: func(protocol string) bool { ctx.Log.Logf("gqlws", "UPGRADE_PROTOCOL: %s", string(protocol))