Fix SAT warnings (#14214)

Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
This commit is contained in:
Holger Friedrich
2023-01-13 19:10:59 +01:00
committed by GitHub
parent 4dd60bb442
commit ee54882841
10 changed files with 57 additions and 52 deletions

View File

@@ -155,6 +155,7 @@ You must either
* port forward your openHAB installation to port 80,
(`iptables -t nat -A PREROUTING -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 8080`)
* install a reverse proxy on port 80, for example nginx with the following configuration:
```
server {
listen 80;
@@ -167,10 +168,12 @@ You must either
}
}
```
* or let openHAB run on port 80 (the entire java process requires elevated privileges).
* For Amazon Echo the pairing process may fail due to a 302 response from openHAB, this can be resolved by using a reverse proxy to change the request url from `/api` to `/api/`, for example nginx with the following configuration:
```
```
server {
listen 80;
location /api {
@@ -178,6 +181,7 @@ You must either
}
}
```
Please open port 80 tcp and port 1900 udp in your firewall installation.
You can test if the hue emulation does its job by enabling pairing mode including the option "Amazon Echo device discovery fix".

View File

@@ -74,7 +74,7 @@ public class NetworkUtils {
/**
* Adds cors headers to the given response and returns it.
*/
public static ResponseBuilder ResponseWithCors(ResponseBuilder response) {
public static ResponseBuilder responseWithCors(ResponseBuilder response) {
return response.encoding(StandardCharsets.UTF_8.name()) //
.header("Access-Control-Allow-Origin", "*")
.header("Access-Control-Allow-Headers", "origin, content-type, accept, authorization")

View File

@@ -95,7 +95,7 @@ public class CommonSetup {
@SuppressWarnings("unchecked")
@Override
public <T> Storage<T> getStorage(String name) {
if (name.equals("hueEmulationUsers")) {
if ("hueEmulationUsers".equals(name)) {
return (Storage<T>) new DummyUsersStorage();
}
throw new IllegalStateException();

View File

@@ -122,7 +122,7 @@ public class UsersAndConfigTests {
}
@Test
public void UnauthorizedAccessTest() {
public void unauthorizedAccessTest() {
// Unauthorized config
Response response;
response = commonSetup.client.target(commonSetup.basePath + "/config").request().get();