Skip to content

Commit ed6f580

Browse files
authored
Merge pull request lightbody#666 from jekh/update-to-guava-22-and-other-dependencies
Fix incompatibility with Guava 22 & update other dependencies
2 parents 6a257e9 + a87b935 commit ed6f580

File tree

10 files changed

+33
-71
lines changed

10 files changed

+33
-71
lines changed

browsermob-core/src/main/java/net/lightbody/bmp/filters/HttpsAwareFiltersAdapter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public String getHost(HttpRequest modifiedRequest) {
102102
String serverHost;
103103
if (isHttps()) {
104104
HostAndPort hostAndPort = HostAndPort.fromString(getHttpsRequestHostAndPort());
105-
serverHost = hostAndPort.getHostText();
105+
serverHost = hostAndPort.getHost();
106106
} else {
107107
serverHost = HttpUtil.getHostFromRequest(modifiedRequest);
108108
}

browsermob-core/src/main/java/net/lightbody/bmp/filters/ResolvedHostnameCacheFilter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public void proxyToServerResolutionSucceeded(String serverHostAndPort, InetSocke
5353
if (resolvedAddress != null) {
5454
// place the resolved host into the hostname cache, so subsequent requests will be able to identify the IP address
5555
HostAndPort parsedHostAndPort = HostAndPort.fromString(serverHostAndPort);
56-
String host = parsedHostAndPort.getHostText();
56+
String host = parsedHostAndPort.getHost();
5757

5858
if (host != null && !host.isEmpty()) {
5959
resolvedAddresses.put(host, resolvedAddress.getHostAddress());

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ public static String removeMatchingPort(String hostWithPort, int portNumber) {
276276
HostAndPort parsedHostAndPort = HostAndPort.fromString(hostWithPort);
277277
if (parsedHostAndPort.hasPort() && parsedHostAndPort.getPort() == portNumber) {
278278
// HostAndPort.getHostText() strips brackets from ipv6 addresses, so reparse using fromHost
279-
return HostAndPort.fromHost(parsedHostAndPort.getHostText()).toString();
279+
return HostAndPort.fromHost(parsedHostAndPort.getHost()).toString();
280280
} else {
281281
return hostWithPort;
282282
}

browsermob-dist/pom.xml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
34
<parent>
45
<artifactId>browsermob-proxy</artifactId>
56
<groupId>net.lightbody.bmp</groupId>
@@ -98,7 +99,7 @@
9899
<plugin>
99100
<groupId>org.apache.maven.plugins</groupId>
100101
<artifactId>maven-shade-plugin</artifactId>
101-
<version>2.4.3</version>
102+
<version>3.0.0</version>
102103
<executions>
103104
<execution>
104105
<phase>package</phase>
@@ -117,7 +118,8 @@
117118
</filter>
118119
</filters>
119120
<transformers>
120-
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
121+
<transformer
122+
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
121123
<mainClass>net.lightbody.bmp.proxy.Main</mainClass>
122124
</transformer>
123125
</transformers>

browsermob-legacy/src/main/java/net/lightbody/bmp/BrowserMobProxyServerLegacyAdapter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ public void setOptions(Map<String, String> options) {
504504
log.warn("Chained proxy support through setOptions is deprecated. Use setUpstreamProxy() to enable chained proxy support.");
505505

506506
HostAndPort hostAndPort = HostAndPort.fromString(httpProxy);
507-
this.setChainedProxy(new InetSocketAddress(hostAndPort.getHostText(), hostAndPort.getPortOrDefault(80)));
507+
this.setChainedProxy(new InetSocketAddress(hostAndPort.getHost(), hostAndPort.getPortOrDefault(80)));
508508
} else {
509509
if (errorOnUnsupportedOperation) {
510510
throw new UnsupportedOperationException("The LittleProxy-based implementation of BrowserMob Proxy does not support the setOptions method. Use the methods defined in the BrowserMobProxy interface to set connection parameters.");

browsermob-legacy/src/test/java/net/lightbody/bmp/proxy/SslTest.java

Lines changed: 0 additions & 44 deletions
This file was deleted.

mitm/pom.xml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
34
<parent>
45
<artifactId>browsermob-proxy</artifactId>
56
<groupId>net.lightbody.bmp</groupId>
@@ -13,9 +14,10 @@
1314

1415
<dependencies>
1516
<dependency>
16-
<groupId>org.littleshoot</groupId>
17+
<!-- Temporarily using the BMP release of littleproxy because LP 1.1.2 is incompatible with guava 22+ -->
18+
<groupId>net.lightbody.bmp</groupId>
1719
<artifactId>littleproxy</artifactId>
18-
<version>1.1.2</version>
20+
<version>1.1.0-beta-bmp-17</version>
1921
<optional>true</optional>
2022
<exclusions>
2123
<exclusion>

mitm/src/main/java/net/lightbody/bmp/mitm/TrustSource.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ public TrustSource add(File trustedCAPemFile) {
174174

175175
String pemFileContents;
176176
try {
177-
pemFileContents = Files.toString(trustedCAPemFile, StandardCharsets.UTF_8);
177+
pemFileContents = Files.asCharSource(trustedCAPemFile, StandardCharsets.UTF_8).read();
178178
} catch (IOException e) {
179179
throw new UncheckedIOException("Unable to read file containing PEM-encoded trusted CAs: " + trustedCAPemFile.getAbsolutePath(), e);
180180
}

mitm/src/main/java/net/lightbody/bmp/util/HttpUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ private static String parseHostHeader(HttpRequest httpRequest, boolean includePo
114114
return hostAndPort;
115115
} else {
116116
HostAndPort parsedHostAndPort = HostAndPort.fromString(hostAndPort);
117-
return parsedHostAndPort.getHostText();
117+
return parsedHostAndPort.getHost();
118118
}
119119
} else {
120120
return null;

pom.xml

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
23
<modelVersion>4.0.0</modelVersion>
34
<groupId>net.lightbody.bmp</groupId>
45
<artifactId>browsermob-proxy</artifactId>
@@ -43,8 +44,8 @@
4344
<connection>scm:git:git@github.com:lightbody/browsermob-proxy.git</connection>
4445
<developerConnection>scm:git:git@github.com:lightbody/browsermob-proxy.git</developerConnection>
4546
<url>git@github.com:lightbody/browsermob-proxy.git</url>
46-
<tag>HEAD</tag>
47-
</scm>
47+
<tag>HEAD</tag>
48+
</scm>
4849

4950
<distributionManagement>
5051
<snapshotRepository>
@@ -61,23 +62,23 @@
6162
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
6263
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
6364

64-
<slf4j.version>1.7.24</slf4j.version>
65+
<slf4j.version>1.7.25</slf4j.version>
6566
<selenium.version>2.53.1</selenium.version>
6667

67-
<jackson.version>2.8.7</jackson.version>
68+
<jackson.version>2.8.9</jackson.version>
6869

6970
<maven-jar-plugin.version>3.0.2</maven-jar-plugin.version>
7071

71-
<log4j.version>2.8</log4j.version>
72+
<log4j.version>2.8.2</log4j.version>
7273

73-
<groovy.version>2.4.8</groovy.version>
74+
<groovy.version>2.4.12</groovy.version>
7475
<groovy-eclipse-batch.version>2.4.3-01</groovy-eclipse-batch.version>
7576

76-
<netty.version>4.0.44.Final</netty.version>
77+
<netty.version>4.0.49.Final</netty.version>
7778
<!-- netty 4.1 version to use for browsermob-dist and when using the netty-4.1 profile -->
78-
<netty-4.1.version>4.1.8.Final</netty-4.1.version>
79+
<netty-4.1.version>4.1.13.Final</netty-4.1.version>
7980

80-
<bouncycastle.version>1.56</bouncycastle.version>
81+
<bouncycastle.version>1.57</bouncycastle.version>
8182
</properties>
8283

8384
<build>
@@ -97,7 +98,7 @@
9798
<plugin>
9899
<groupId>org.apache.maven.plugins</groupId>
99100
<artifactId>maven-compiler-plugin</artifactId>
100-
<version>3.6.0</version>
101+
<version>3.6.1</version>
101102
<configuration>
102103
<compilerId>groovy-eclipse-compiler</compilerId>
103104
<source>1.7</source>
@@ -178,7 +179,7 @@
178179
<plugin>
179180
<groupId>org.apache.maven.plugins</groupId>
180181
<artifactId>maven-dependency-plugin</artifactId>
181-
<version>2.10</version>
182+
<version>3.0.0</version>
182183
</plugin>
183184
</plugins>
184185
</pluginManagement>
@@ -211,7 +212,8 @@
211212
<dependency>
212213
<groupId>com.google.guava</groupId>
213214
<artifactId>guava</artifactId>
214-
<version>20.0</version>
215+
<!-- Remove the -android when dropping support for Java 7. -->
216+
<version>22.0-android</version>
215217
</dependency>
216218

217219
<dependency>
@@ -245,7 +247,7 @@
245247
<dependency>
246248
<groupId>org.mockito</groupId>
247249
<artifactId>mockito-core</artifactId>
248-
<version>2.7.12</version>
250+
<version>2.8.47</version>
249251
</dependency>
250252

251253
<dependency>
@@ -272,7 +274,7 @@
272274
<dependency>
273275
<groupId>net.lightbody.bmp</groupId>
274276
<artifactId>littleproxy</artifactId>
275-
<version>1.1.0-beta-bmp-16</version>
277+
<version>1.1.0-beta-bmp-17</version>
276278
</dependency>
277279

278280
<dependency>

0 commit comments

Comments
 (0)