Juan Hernandez has uploaded a new change for review. Change subject: webadmin: Use /api/ instead of /api ......................................................................
webadmin: Use /api/ instead of /api The GUI uses the /api URL to get a RESTAPI session that can then be used by plugins. When using basic authentication this means that the browser will remember the credentials and send them back to any request for URLs with paths starting with /, all. With the trailing slash it will send them only to URLs ending with /api/. Change-Id: I096a8769ff018f60366ab4ec8d2425c7f8d0f7e2 Signed-off-by: Juan Hernandez <juan.hernan...@redhat.com> --- M frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/plugin/restapi/RestApiSessionManager.java 1 file changed, 4 insertions(+), 1 deletion(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/31/21431/1 diff --git a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/plugin/restapi/RestApiSessionManager.java b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/plugin/restapi/RestApiSessionManager.java index c67dd0e..20ac492 100644 --- a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/plugin/restapi/RestApiSessionManager.java +++ b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/plugin/restapi/RestApiSessionManager.java @@ -68,7 +68,10 @@ public RestApiSessionManager(EventBus eventBus, ClientStorage clientStorage) { this.eventBus = eventBus; this.clientStorage = clientStorage; - this.restApiBaseUrl = FrontendUrlUtils.getRootURL() + "api"; //$NON-NLS-1$ + // Note that the slash at the end of the URL is not just a whim. With the trailing slash the browser will only + // send authentication headers to URLs ending in api/, otherwise it will send them to URLs ending in /, and + // this causes problems in other applications, for example in the reports application. + this.restApiBaseUrl = FrontendUrlUtils.getRootURL() + "api/"; //$NON-NLS-1$ } void sendRequest(RequestBuilder requestBuilder, RestApiCallback callback) { -- To view, visit http://gerrit.ovirt.org/21431 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I096a8769ff018f60366ab4ec8d2425c7f8d0f7e2 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Juan Hernandez <juan.hernan...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches