Skip to content

Commit 3d70be8

Browse files
committed
Merge pull request #320 from jekh/suppress-hostname-on-via-header
Suppressing hostname on Via header to protect privacy
2 parents fc15cdd + 09148f2 commit 3d70be8

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

browsermob-core-littleproxy/src/main/java/net/lightbody/bmp/BrowserMobProxyServer.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,11 @@ public class BrowserMobProxyServer implements BrowserMobProxy, LegacyProxyServer
8989
//TODO: extract the version string into a more suitable location
9090
private static final HarNameVersion HAR_CREATOR_VERSION = new HarNameVersion("BrowserMob Proxy", "2.1.0-beta-3-littleproxy");
9191

92+
/**
93+
* The default pseudonym to use when adding the Via header to proxied requests.
94+
*/
95+
public static final String VIA_HEADER_ALIAS = "browsermobproxy";
96+
9297
/**
9398
* True only after the proxy has been successfully started.
9499
*/
@@ -320,7 +325,8 @@ public int getMaximumResponseBufferSizeInBytes() {
320325
.withServerResolver(delegatingResolver)
321326
.withAddress(clientBindSocket)
322327
.withConnectTimeout(connectTimeoutMs)
323-
.withIdleConnectionTimeout(idleConnectionTimeoutSec);
328+
.withIdleConnectionTimeout(idleConnectionTimeoutSec)
329+
.withProxyAlias(VIA_HEADER_ALIAS);
324330

325331
if (serverBindAddress != null) {
326332
bootstrap.withNetworkInterface(new InetSocketAddress(serverBindAddress, 0));

0 commit comments

Comments
 (0)