Skip to content

Commit

Permalink
HAWKULAR-992 Return 400 if Hawkular-Tenant is set on Hawkular deploym…
Browse files Browse the repository at this point in the history
…ents
  • Loading branch information
lucasponce committed Feb 9, 2016
1 parent bd340c2 commit 49c5645
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ class AbstractITestBase {
This is used for non-bus scenarios.
In Bus scenarios this property is skipped
*/
client.headers.put("Hawkular-Tenant", testTenant)
if (System.getProperty("standalone-test") != null) {
client.headers.put("Hawkular-Tenant", testTenant)
}
}

@BeforeClass
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2015 Red Hat, Inc. and/or its affiliates
* Copyright 2015-2016 Red Hat, Inc. and/or its affiliates
* and other contributors as indicated by the @author tags.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -43,6 +43,10 @@ public class PersonaFilter implements ContainerRequestFilter {

@Override
public void filter(ContainerRequestContext requestContext) throws IOException {
if (requestContext.getHeaderString(HawkularAlertsApp.TENANT_HEADER_NAME) != null) {
requestContext.abortWith(ResponseUtil.badRequest(HawkularAlertsApp.TENANT_HEADER_NAME + " " +
"should not be provided on Hawkular deployment."));
}
if (!checkPersona()) {
requestContext.abortWith(ResponseUtil.internalError("No persona found"));
}
Expand Down

0 comments on commit 49c5645

Please sign in to comment.