diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2020-03-27 19:17:45 +0200 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2020-03-27 19:17:51 +0200 |
commit | 279c4e5ad1952478221ab7be883d750fbfe38c9c (patch) | |
tree | 44b336d63990497588e5d0150a339d81c4380810 /src/main/java/org/jenkinsci/plugins | |
parent | 942c650dd2103cc7f50d5b15274c79017f60cc70 (diff) | |
download | bbprb-master.tar.gz |
Bitbucket server uses different user agents
Diffstat (limited to 'src/main/java/org/jenkinsci/plugins')
-rw-r--r-- | src/main/java/org/jenkinsci/plugins/bbprb/BitbucketHookReceiver.java | 9 |
1 files changed, 0 insertions, 9 deletions
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, |