From 29913cf5bd0c43fe372fa624be7582a9fe176531 Mon Sep 17 00:00:00 2001 From: mountford Date: Thu, 16 Nov 2017 08:52:06 -0800 Subject: [PATCH] Suppress a logging statement most of the time Most of the time, we don't expect incoming requests to have an authorization header. So this statement gets printed a lot, and doesn't provide much useful information. We already have a statement listing what type of authentication/authorization is required by the endpoint, and other statements indicating either that authorization was successful with a particular method or was not successful at all. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=175969652 --- .../registry/request/auth/OAuthAuthenticationMechanism.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/java/google/registry/request/auth/OAuthAuthenticationMechanism.java b/java/google/registry/request/auth/OAuthAuthenticationMechanism.java index 9b196e04d..4d00807e1 100644 --- a/java/google/registry/request/auth/OAuthAuthenticationMechanism.java +++ b/java/google/registry/request/auth/OAuthAuthenticationMechanism.java @@ -75,7 +75,9 @@ public class OAuthAuthenticationMechanism implements AuthenticationMechanism { // OAuthService itself only looks at the first one anyway. String header = request.getHeader(AUTHORIZATION); if ((header == null) || !header.startsWith(BEARER_PREFIX)) { - logger.infofmt("missing or invalid authorization header"); + if (header != null) { + logger.infofmt("invalid authorization header"); + } return AuthResult.create(NONE); } // Assume that, if a bearer token is found, it's what OAuthService will use to attempt