Skip to content
This repository was archived by the owner on Jul 26, 2023. It is now read-only.

Commit f67c671

Browse files
Fix header injection for rest module and promote version (#26)
* Fix header injection for rest module and promote version * Snapshot version bump
1 parent 195c44a commit f67c671

File tree

10 files changed

+15
-11
lines changed

10 files changed

+15
-11
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ When you build the latest code from source, you'll have access to the latest sna
396396
<dependency>
397397
<groupId>net.lightbody.bmp</groupId>
398398
<artifactId>browsermob-core</artifactId>
399-
<version>2.1.34-SNAPSHOT</version>
399+
<version>2.1.35-SNAPSHOT</version>
400400
<scope>test</scope>
401401
</dependency>
402402
```

browsermob-core/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<artifactId>browsermob-proxy</artifactId>
88
<groupId>net.lightbody.bmp</groupId>
9-
<version>2.1.34-SNAPSHOT</version>
9+
<version>2.1.35-SNAPSHOT</version>
1010
</parent>
1111
<modelVersion>4.0.0</modelVersion>
1212

browsermob-core/src/main/java/net/lightbody/bmp/util/BrowserMobHttpUtil.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,8 @@ public static boolean hasTextualContent(String contentType) {
171171
contentType.startsWith("application/javascript") ||
172172
contentType.startsWith("application/json") ||
173173
contentType.startsWith("application/xml") ||
174-
contentType.startsWith("application/xhtml+xml")
174+
contentType.startsWith("application/xhtml+xml") ||
175+
(contentType.startsWith("application/") && contentType.endsWith("+json"))
175176
);
176177
}
177178

browsermob-dist/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<artifactId>browsermob-proxy</artifactId>
66
<groupId>net.lightbody.bmp</groupId>
7-
<version>2.1.34-SNAPSHOT</version>
7+
<version>2.1.35-SNAPSHOT</version>
88
</parent>
99
<modelVersion>4.0.0</modelVersion>
1010

browsermob-legacy/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<artifactId>browsermob-proxy</artifactId>
88
<groupId>net.lightbody.bmp</groupId>
9-
<version>2.1.34-SNAPSHOT</version>
9+
<version>2.1.35-SNAPSHOT</version>
1010
</parent>
1111
<modelVersion>4.0.0</modelVersion>
1212

browsermob-legacy/src/main/java/net/lightbody/bmp/proxy/http/BrowserMobHttpClient.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1100,7 +1100,8 @@ private boolean hasTextualContent(String contentType) {
11001100
contentType.startsWith("application/javascript") ||
11011101
contentType.startsWith("application/json") ||
11021102
contentType.startsWith("application/xml") ||
1103-
contentType.startsWith("application/xhtml+xml");
1103+
contentType.startsWith("application/xhtml+xml") ||
1104+
(contentType.startsWith("application/") && contentType.endsWith("+json"));
11041105
}
11051106

11061107
private void setBinaryContentOfEntry(HarEntry entry, ByteArrayOutputStream copy) {

browsermob-rest/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<artifactId>browsermob-proxy</artifactId>
77
<groupId>net.lightbody.bmp</groupId>
8-
<version>2.1.34-SNAPSHOT</version>
8+
<version>2.1.35-SNAPSHOT</version>
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111

browsermob-rest/src/main/java/net/lightbody/bmp/proxy/bricks/ProxyResource.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,11 +273,13 @@ public Reply<?> updateHeaders(@Named("port") int port, Request<String> request)
273273

274274
Map<String, String> mappedJsonRequest = request.read(Map.class).as(Json.class);
275275
mappedJsonRequest.entrySet().stream()
276-
.filter(stringStringEntry -> stringStringEntry.getKey().equalsIgnoreCase("headersFilterRegexp"))
276+
.filter(stringStringEntry -> !stringStringEntry.getKey().equalsIgnoreCase("headersFilterRegexp"))
277277
.forEach(stringStringEntry -> proxy.addHeader(stringStringEntry.getKey(), stringStringEntry.getValue()));
278278

279279
mappedJsonRequest.entrySet().stream().filter(stringStringEntry ->
280-
stringStringEntry.getKey().equalsIgnoreCase("headersFilterRegexp") && StringUtils.isNotEmpty(stringStringEntry.getValue())).findFirst().ifPresent(stringStringEntry -> proxy.headerFilterRegexp(stringStringEntry.getValue()));
280+
stringStringEntry.getKey().equalsIgnoreCase("headersFilterRegexp")
281+
&& StringUtils.isNotEmpty(stringStringEntry.getValue())).findFirst()
282+
.ifPresent(stringStringEntry -> proxy.headerFilterRegexp(stringStringEntry.getValue()));
281283

282284
return Reply.saying().ok();
283285
}

mitm/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<artifactId>browsermob-proxy</artifactId>
66
<groupId>net.lightbody.bmp</groupId>
7-
<version>2.1.34-SNAPSHOT</version>
7+
<version>2.1.35-SNAPSHOT</version>
88
</parent>
99
<modelVersion>4.0.0</modelVersion>
1010

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>net.lightbody.bmp</groupId>
55
<artifactId>browsermob-proxy</artifactId>
6-
<version>2.1.34-SNAPSHOT</version>
6+
<version>2.1.35-SNAPSHOT</version>
77
<modules>
88
<module>browsermob-core</module>
99
<module>browsermob-legacy</module>

0 commit comments

Comments
 (0)