Skip to content

Commit 2496112

Browse files
deinhofersabicalija
authored andcommitted
Bug fix openhab3 REST API: If the Accept types are not explicitly specified, the request fails with error code 400 or 401
1 parent f09b601 commit 2496112

File tree

1 file changed

+2
-0
lines changed
  • ARE/components/processor.openhab/src/main/java/eu/asterics/component/processor/openhab

1 file changed

+2
-0
lines changed

ARE/components/processor.openhab/src/main/java/eu/asterics/component/processor/openhab/openHABInstance.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -872,6 +872,8 @@ public void checkServerTrusted(X509Certificate[] certs, String authType) {
872872
System.setProperty("sun.security.ssl.allowUnsafeRenegotiation", "true");
873873
URL url = new URL(urlStr);
874874
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
875+
//Bug fix openhab3 REST API: If the Accept types are not explicitly specified, the request fails with error code 400 or 401.
876+
conn.setRequestProperty("Accept","text/plain,application/json");
875877

876878
// check for an username, if given, authenticate via HTTP BASIC
877879
if (this.username.length() != 0) {

0 commit comments

Comments
 (0)