mirror of
https://github.com/signalapp/Signal-Server
synced 2026-04-20 21:38:06 +01:00
Add JettyHttpConfigurationCustomizer
This commit is contained in:
@@ -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) {
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user