Skip to content

Commit

Permalink
throw ISE if WebSocketSCI.configure() is called on started ServletCon…
Browse files Browse the repository at this point in the history
…textHandler

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
  • Loading branch information
lachlan-roberts authored and joakime committed Oct 15, 2020
1 parent 5e60837 commit dc74bcf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ public interface Configurator
*/
public static void configure(ServletContextHandler context, Configurator configurator)
{
if (context.isStarted())
throw new IllegalStateException("configure should be called before starting");

// In this embedded-jetty usage, allow ServletContext.addListener() to
// add other ServletContextListeners (such as the ContextDestroyListener) after
// the initialization phase is over. (important for this SCI to function)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ public interface Configurator
*/
public static void configure(ServletContextHandler context, Configurator configurator)
{
if (context.isStarted())
throw new IllegalStateException("configure should be called before starting");

context.addEventListener(
ContainerInitializer
.asContextListener(new JettyWebSocketServletContainerInitializer())
Expand Down

0 comments on commit dc74bcf

Please sign in to comment.