Refactor secret check · apache/tomcat@49ad3f9 · GitHub
Skip to content

Commit

Permalink
Refactor secret check
Browse files Browse the repository at this point in the history
Moving the check to start allows invalid configurations to be fixed via
JMX and changes to be made followed by stop()/start() for those changes
to take effect.
  • Loading branch information
markt-asf committed Feb 5, 2020
1 parent ab9bc7e commit 49ad3f9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions java/org/apache/coyote/ajp/AbstractAjpProtocol.java
Original file line number Diff line number Diff line change
Expand Up @@ -257,13 +257,13 @@ protected Processor createUpgradeProcessor(SocketWrapperBase<?> socket,


@Override
public void init() throws Exception {
public void start() throws Exception {
if (getSecretRequired()) {
String secret = getSecret();
if (secret == null || secret.length() == 0) {
throw new IllegalArgumentException(sm.getString("ajpprotocol.nosecret"));
}
}
super.init();
super.start();
}
}

0 comments on commit 49ad3f9

Please sign in to comment.