New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding check is path is unset (or "/") for `web_listen_uri` parameter. #2208

Merged
merged 3 commits into from May 10, 2016

Conversation

Projects
None yet
2 participants
@dennisoelkers
Member

dennisoelkers commented May 10, 2016

Right now we cannot handle a path prefix for the web interface assets, because of the way they are bundled. The config parameter allows one, so we need to explicitly check for it and raise an error when it is set to prevent undefined/unexpected behavior.

Fixes #2191.

@dennisoelkers dennisoelkers added this to the 2.0.1 milestone May 10, 2016

public class WebListenUriValidator implements Validator<URI> {
@Override
public void validate(String name, URI value) throws ValidationException {
if (value != null && !value.getPath().equals("/")) {

This comment has been minimized.

@joschi

joschi May 10, 2016

Contributor

Unfortunately URI#getPath() can return null which would lead to a NullPointerException here. Maybe just invert the second condition ("/".equals(…)).

This comment has been minimized.

@dennisoelkers

dennisoelkers May 10, 2016

Member

👍 - thanks for the hint! :)


import java.net.URI;

public class WebListenUriValidator implements Validator<URI> {

This comment has been minimized.

@joschi

joschi May 10, 2016

Contributor

Just FYI, this could also be done with a ValidatorMethod directly in Configuration, but having a dedicated validator is also fine.

This comment has been minimized.

@dennisoelkers

dennisoelkers May 10, 2016

Member

Thanks for the heads up!

@joschi joschi self-assigned this May 10, 2016

@joschi

This comment has been minimized.

Contributor

joschi commented May 10, 2016

LGTM. 👍

@joschi joschi merged commit 0d80381 into master May 10, 2016

4 checks passed

ci-server-integration Jenkins build graylog2-server-integration-pr 894 has succeeded
Details
ci-web-linter Jenkins build graylog-pr-linter-check 382 has succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@joschi joschi deleted the issue-2191 branch May 10, 2016

joschi added a commit that referenced this pull request May 10, 2016

joschi added a commit to Graylog2/documentation that referenced this pull request May 10, 2016

@joschi joschi added the web label May 10, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment