From 36550adbc5ffe8304015a97ca8f3c20673382c35 Mon Sep 17 00:00:00 2001 From: Tomas Bjerre Date: Mon, 14 Sep 2015 18:05:11 +0200 Subject: [PATCH] Adding header 'X-Atlassian-Token: no-check' to be compatible with Stash 4.0 #12 --- CHANGELOG.md | 3 +++ .../java/org/jenkinsci/plugins/jvcts/stash/StashInvoker.java | 1 + 2 files changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 29376f8..99d1784 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ Changelog of Violation Comments to Stash Plugin +# 1.9 +* Adding header "X-Atlassian-Token: no-check" to be compatible with Stash 4.0 #12 + # 1.8 * Accepting cookies sent from Stash server. To prevent infinite redirect if Stash requires authentication. diff --git a/src/main/java/org/jenkinsci/plugins/jvcts/stash/StashInvoker.java b/src/main/java/org/jenkinsci/plugins/jvcts/stash/StashInvoker.java index 5770a3a..b11d2f3 100644 --- a/src/main/java/org/jenkinsci/plugins/jvcts/stash/StashInvoker.java +++ b/src/main/java/org/jenkinsci/plugins/jvcts/stash/StashInvoker.java @@ -42,6 +42,7 @@ public String invokeUrl(ViolationsToStashConfig config, String url, Method metho conn.setRequestMethod(method.name()); String charset = "UTF-8"; conn.setDoOutput(true); + conn.setRequestProperty("X-Atlassian-Token", "no-check"); conn.setRequestProperty("Content-Type", "application/json"); conn.setRequestProperty("Accept", "application/json"); conn.connect();