Add JettyHttpConfigurationCustomizer
This commit is contained in:
parent
2c2b5d555e
commit
459882e6fa
|
@ -141,6 +141,7 @@ import org.whispersystems.textsecuregcm.grpc.ProfileGrpcService;
|
||||||
import org.whispersystems.textsecuregcm.grpc.UserAgentInterceptor;
|
import org.whispersystems.textsecuregcm.grpc.UserAgentInterceptor;
|
||||||
import org.whispersystems.textsecuregcm.grpc.net.ManagedDefaultEventLoopGroup;
|
import org.whispersystems.textsecuregcm.grpc.net.ManagedDefaultEventLoopGroup;
|
||||||
import org.whispersystems.textsecuregcm.grpc.net.ManagedLocalGrpcServer;
|
import org.whispersystems.textsecuregcm.grpc.net.ManagedLocalGrpcServer;
|
||||||
|
import org.whispersystems.textsecuregcm.jetty.JettyHttpConfigurationCustomizer;
|
||||||
import org.whispersystems.textsecuregcm.limits.CardinalityEstimator;
|
import org.whispersystems.textsecuregcm.limits.CardinalityEstimator;
|
||||||
import org.whispersystems.textsecuregcm.limits.PushChallengeManager;
|
import org.whispersystems.textsecuregcm.limits.PushChallengeManager;
|
||||||
import org.whispersystems.textsecuregcm.limits.RateLimitChallengeManager;
|
import org.whispersystems.textsecuregcm.limits.RateLimitChallengeManager;
|
||||||
|
@ -339,6 +340,8 @@ public class WhisperServerService extends Application<WhisperServerConfiguration
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
environment.lifecycle().addEventListener(new JettyHttpConfigurationCustomizer());
|
||||||
|
|
||||||
HeaderControlledResourceBundleLookup headerControlledResourceBundleLookup =
|
HeaderControlledResourceBundleLookup headerControlledResourceBundleLookup =
|
||||||
new HeaderControlledResourceBundleLookup();
|
new HeaderControlledResourceBundleLookup();
|
||||||
ConfiguredProfileBadgeConverter profileBadgeConverter = new ConfiguredProfileBadgeConverter(
|
ConfiguredProfileBadgeConverter profileBadgeConverter = new ConfiguredProfileBadgeConverter(
|
||||||
|
|
|
@ -0,0 +1,33 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2024 Signal Messenger, LLC
|
||||||
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.whispersystems.textsecuregcm.jetty;
|
||||||
|
|
||||||
|
import org.eclipse.jetty.server.Connector;
|
||||||
|
import org.eclipse.jetty.server.HttpConnectionFactory;
|
||||||
|
import org.eclipse.jetty.util.component.Container;
|
||||||
|
import org.eclipse.jetty.util.component.LifeCycle;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Uses {@link Container.Listener} to update {@link org.eclipse.jetty.server.HttpConfiguration}
|
||||||
|
*/
|
||||||
|
public class JettyHttpConfigurationCustomizer implements Container.Listener, LifeCycle.Listener {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void beanAdded(final Container parent, final Object child) {
|
||||||
|
if (child instanceof Connector c) {
|
||||||
|
final HttpConnectionFactory hcf = c.getConnectionFactory(HttpConnectionFactory.class);
|
||||||
|
if (hcf != null) {
|
||||||
|
// see https://github.com/jetty/jetty.project/issues/1891
|
||||||
|
hcf.getHttpConfiguration().setNotifyRemoteAsyncErrors(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void beanRemoved(final Container parent, final Object child) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue