Skip to content

Commit 4e6492e

Browse files
committed
Handle Jira CSRF token
1 parent 4677b85 commit 4e6492e

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

lib/assertthat-bdd.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,11 @@ const downloadFeatures = function (settings, callback) {
2828
port: settings.proxyPort
2929
} : undefined,
3030
headers: settings.token ? {
31-
'Authorization': 'Bearer ' + settings.token
32-
} : undefined,
31+
'Authorization': 'Bearer ' + settings.token,
32+
'X-Atlassian-Token': 'no-check'
33+
} : {
34+
'X-Atlassian-Token': 'no-check'
35+
},
3336
auth: settings.token ? undefined : {
3437
username: settings.accessKey,
3538
password: settings.secretKey
@@ -113,7 +116,12 @@ async function sendReport(settings, filename, runId) {
113116
const response = await axios.post(reportUrl, formData, {
114117
headers: {
115118
...formData.getHeaders(),
116-
...settings.token ? { 'Authorization': 'Bearer ' + settings.token } : {}
119+
...settings.token ? {
120+
'Authorization': 'Bearer ' + settings.token,
121+
'X-Atlassian-Token': 'no-check'
122+
} : {
123+
'X-Atlassian-Token': 'no-check'
124+
}
117125
},
118126
proxy: settings.proxyHost ? {
119127
protocol: 'http',

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@assertthat/assertthat-bdd",
3-
"version": "2.0.0",
3+
"version": "2.0.1",
44
"description": "Node.js module for integration with AssertThat BDD Jira plugin",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)