Skip to content

Commit cf1faa2

Browse files
committed
Ignore CSRF check
1 parent 5dc412d commit cf1faa2

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

pom.xml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
<groupId>com.assertthat.plugins</groupId>
77
<artifactId>assertthat-bdd-standalone</artifactId>
8-
<version>1.9.11</version>
8+
<version>1.9.12</version>
99
<name>assertthat-bdd-standalone</name>
1010
<description>AssertThat BDD Jira plugin client standalone</description>
1111
<url>http://www.assertthat.com</url>
@@ -60,6 +60,12 @@
6060
<artifactId>okhttp</artifactId>
6161
<version>4.12.0</version>
6262
</dependency>
63+
<dependency>
64+
<groupId>junit</groupId>
65+
<artifactId>junit</artifactId>
66+
<version>4.13.1</version>
67+
<scope>test</scope>
68+
</dependency>
6369
</dependencies>
6470

6571
<build>

src/main/java/com/assertthat/plugins/standalone/APIUtil.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ public Long upload(Long runId, String runName, String filePath, String type, Str
125125
Request request = new Request.Builder()
126126
.url(httpBuilder.build())
127127
.post(requestBody)
128-
.addHeader("User-Agent", USER_AGENT)
129128
.addHeader("X-Atlassian-Token", "no-check")
130129
.build();
131130
Response response = client.newCall(request).execute();

src/main/java/com/assertthat/plugins/standalone/OkHttpClientBuilder.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,9 @@ class BasicAuthInterceptor implements Interceptor {
8888
public Response intercept(Chain chain) throws IOException {
8989
Request request = chain.request();
9090
Request authenticatedRequest = request.newBuilder()
91-
.header("Authorization", credentials).build();
91+
.header("Authorization", credentials)
92+
.header("X-Atlassian-Token", "no-check")
93+
.build();
9294
return chain.proceed(authenticatedRequest);
9395
}
9496

@@ -106,7 +108,9 @@ class TokenAuthInterceptor implements Interceptor {
106108
public Response intercept(Chain chain) throws IOException {
107109
Request request = chain.request();
108110
Request authenticatedRequest = request.newBuilder()
109-
.header("Authorization", "Bearer " + token).build();
111+
.header("Authorization", "Bearer " + token)
112+
.header("X-Atlassian-Token", "no-check")
113+
.build();
110114
return chain.proceed(authenticatedRequest);
111115
}
112116

0 commit comments

Comments
 (0)