From 5e3bba9ae1ae181511feffcf1854c0f2073b848f Mon Sep 17 00:00:00 2001 From: gudvinr Date: Fri, 15 Aug 2025 19:37:51 +0300 Subject: [PATCH] refactor(request): fix typo in big corp name --- internal/googlereader/handler.go | 2 +- internal/googlereader/middleware.go | 2 +- internal/http/request/context.go | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/internal/googlereader/handler.go b/internal/googlereader/handler.go index 1c002d26..723b7f9b 100644 --- a/internal/googlereader/handler.go +++ b/internal/googlereader/handler.go @@ -230,7 +230,7 @@ func (h *handler) tokenHandler(w http.ResponseWriter, r *http.Request) { return } - token := request.GoolgeReaderToken(r) + token := request.GoogleReaderToken(r) if token == "" { slog.Warn("[GoogleReader] User does not have token", slog.String("client_ip", clientIP), diff --git a/internal/googlereader/middleware.go b/internal/googlereader/middleware.go index 4984cf99..86d08226 100644 --- a/internal/googlereader/middleware.go +++ b/internal/googlereader/middleware.go @@ -181,7 +181,7 @@ func (m *middleware) apiKeyAuth(next http.Handler) http.Handler { ctx = context.WithValue(ctx, request.UserTimezoneContextKey, user.Timezone) ctx = context.WithValue(ctx, request.IsAdminUserContextKey, user.IsAdmin) ctx = context.WithValue(ctx, request.IsAuthenticatedContextKey, true) - ctx = context.WithValue(ctx, request.GoogleReaderToken, token) + ctx = context.WithValue(ctx, request.GoogleReaderTokenKey, token) next.ServeHTTP(w, r.WithContext(ctx)) }) diff --git a/internal/http/request/context.go b/internal/http/request/context.go index a2faab30..236881e7 100644 --- a/internal/http/request/context.go +++ b/internal/http/request/context.go @@ -31,7 +31,7 @@ const ( FlashErrorMessageContextKey LastForceRefreshContextKey ClientIPContextKey - GoogleReaderToken + GoogleReaderTokenKey WebAuthnDataContextKey ) @@ -44,9 +44,9 @@ func WebAuthnSessionData(r *http.Request) *model.WebAuthnSession { return nil } -// GoolgeReaderToken returns the google reader token if it exists. -func GoolgeReaderToken(r *http.Request) string { - return getContextStringValue(r, GoogleReaderToken) +// GoogleReaderToken returns the google reader token if it exists. +func GoogleReaderToken(r *http.Request) string { + return getContextStringValue(r, GoogleReaderTokenKey) } // IsAdminUser checks if the logged user is administrator.