From 279c4e5ad1952478221ab7be883d750fbfe38c9c Mon Sep 17 00:00:00 2001 From: Igor Pashev Date: Fri, 27 Mar 2020 19:17:45 +0200 Subject: Remove check for user agent Bitbucket server uses different user agents --- .../java/org/jenkinsci/plugins/bbprb/BitbucketHookReceiver.java | 9 --------- 1 file changed, 9 deletions(-) (limited to 'src/main') diff --git a/src/main/java/org/jenkinsci/plugins/bbprb/BitbucketHookReceiver.java b/src/main/java/org/jenkinsci/plugins/bbprb/BitbucketHookReceiver.java index 355a901..1757343 100644 --- a/src/main/java/org/jenkinsci/plugins/bbprb/BitbucketHookReceiver.java +++ b/src/main/java/org/jenkinsci/plugins/bbprb/BitbucketHookReceiver.java @@ -32,7 +32,6 @@ public class BitbucketHookReceiver extends CrumbExclusion implements UnprotectedRootAction { private static final String BITBUCKET_HOOK_URL = "bbprb-hook"; - private static final String BITBUCKET_UA = "Bitbucket-Webhooks/2.0"; @Override public boolean process(HttpServletRequest req, HttpServletResponse resp, @@ -49,14 +48,6 @@ public class BitbucketHookReceiver public void doIndex(StaplerRequest req, StaplerResponse resp) throws IOException { - String userAgent = req.getHeader("user-agent"); - if (!BITBUCKET_UA.equals(userAgent)) { - LOGGER.log(Level.WARNING, "Bad user agent: `{0}`, expected `{1}`", - new Object[] {userAgent, BITBUCKET_UA}); - resp.setStatus(StaplerResponse.SC_BAD_REQUEST); - return; - } - String uri = req.getRequestURI(); if (!uri.contains("/" + BITBUCKET_HOOK_URL + "/")) { LOGGER.log(Level.WARNING, -- cgit v1.2.3