Skip to content
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

Allowing to run REST API and web interface on same port. #2515

Merged
merged 9 commits into from Jul 25, 2016

Conversation

dennisoelkers
Copy link
Member

@dennisoelkers dennisoelkers commented Jul 22, 2016

This loads the web interface resources in the REST API service if the rest_listen_uri and web_listen_uri configuration directives contain the same host and port. If this is the case, one of them also must have a different path prefix, the web interface path must be nonempty and different than /.

Additionally, requests going to http://<graylog>:12900 expecting a text/html response are redirected to web_listen_uri if REST and web are running on the same port. The behavior stays the same for JSON requests.

@@ -428,6 +443,32 @@ public void validateWebTlsConfig() throws ValidationException {
}
}

@ValidatorMethod
@SuppressWarnings("unused")
public void validateRestAndWebListenConfigConflict() throws ValidationException {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 for different validator methods. ❤️

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 for implementing them in the first place ❤️

dennisoelkers and others added 4 commits July 25, 2016 16:02
This is adding a Jersey response filter that checks if:

  * the response is a 401 (Unauthorized)
  * the request was a XMLHttpRequest

If this holds true, the `WWW-Authenticate`-header is removed, to prevent
the browser's credentials dialog to pop up for an AJAX call.
@joschi
Copy link
Contributor

joschi commented Jul 25, 2016

LGTM. 👍

@joschi joschi merged commit c5381f6 into master Jul 25, 2016
@joschi joschi deleted the rest-and-web-on-same-port branch July 25, 2016 15:53
jalogisch pushed a commit to Graylog2/documentation that referenced this pull request Jul 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants