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

Fix header injection for rest module and promote version #26

Merged
merged 2 commits into from
Aug 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ When you build the latest code from source, you'll have access to the latest sna
<dependency>
<groupId>net.lightbody.bmp</groupId>
<artifactId>browsermob-core</artifactId>
<version>2.1.34-SNAPSHOT</version>
<version>2.1.35-SNAPSHOT</version>
<scope>test</scope>
</dependency>
```
2 changes: 1 addition & 1 deletion browsermob-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<artifactId>browsermob-proxy</artifactId>
<groupId>net.lightbody.bmp</groupId>
<version>2.1.34-SNAPSHOT</version>
<version>2.1.35-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,8 @@ public static boolean hasTextualContent(String contentType) {
contentType.startsWith("application/javascript") ||
contentType.startsWith("application/json") ||
contentType.startsWith("application/xml") ||
contentType.startsWith("application/xhtml+xml")
contentType.startsWith("application/xhtml+xml") ||
(contentType.startsWith("application/") && contentType.endsWith("+json"))
);
}

Expand Down
2 changes: 1 addition & 1 deletion browsermob-dist/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>browsermob-proxy</artifactId>
<groupId>net.lightbody.bmp</groupId>
<version>2.1.34-SNAPSHOT</version>
<version>2.1.35-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion browsermob-legacy/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<artifactId>browsermob-proxy</artifactId>
<groupId>net.lightbody.bmp</groupId>
<version>2.1.34-SNAPSHOT</version>
<version>2.1.35-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1100,7 +1100,8 @@ private boolean hasTextualContent(String contentType) {
contentType.startsWith("application/javascript") ||
contentType.startsWith("application/json") ||
contentType.startsWith("application/xml") ||
contentType.startsWith("application/xhtml+xml");
contentType.startsWith("application/xhtml+xml") ||
(contentType.startsWith("application/") && contentType.endsWith("+json"));
}

private void setBinaryContentOfEntry(HarEntry entry, ByteArrayOutputStream copy) {
Expand Down
2 changes: 1 addition & 1 deletion browsermob-rest/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>browsermob-proxy</artifactId>
<groupId>net.lightbody.bmp</groupId>
<version>2.1.34-SNAPSHOT</version>
<version>2.1.35-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,11 +273,13 @@ public Reply<?> updateHeaders(@Named("port") int port, Request<String> request)

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

mappedJsonRequest.entrySet().stream().filter(stringStringEntry ->
stringStringEntry.getKey().equalsIgnoreCase("headersFilterRegexp") && StringUtils.isNotEmpty(stringStringEntry.getValue())).findFirst().ifPresent(stringStringEntry -> proxy.headerFilterRegexp(stringStringEntry.getValue()));
stringStringEntry.getKey().equalsIgnoreCase("headersFilterRegexp")
&& StringUtils.isNotEmpty(stringStringEntry.getValue())).findFirst()
.ifPresent(stringStringEntry -> proxy.headerFilterRegexp(stringStringEntry.getValue()));

return Reply.saying().ok();
}
Expand Down
2 changes: 1 addition & 1 deletion mitm/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>browsermob-proxy</artifactId>
<groupId>net.lightbody.bmp</groupId>
<version>2.1.34-SNAPSHOT</version>
<version>2.1.35-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>net.lightbody.bmp</groupId>
<artifactId>browsermob-proxy</artifactId>
<version>2.1.34-SNAPSHOT</version>
<version>2.1.35-SNAPSHOT</version>
<modules>
<module>browsermob-core</module>
<module>browsermob-legacy</module>
Expand Down