elueckel / Unifi-Toolbox

Modul for Symcon integrating UniFi Network devices
2 stars 2 forks source link

UnifiOS 1.11.0 - Trying to access array offset on value of type null #13

Closed Brovning closed 2 years ago

Brovning commented 2 years ago

Nach dem Update of der DreamMachine von UnifiOS 1.10.x auf 1.11.x erscheint eine Fehlermeldung im Logging. image (verwendete Network Version: 6.5.55)

Brovning commented 2 years ago

Korrektur: Es scheint beim Login etwas schiefzugehen. "Cookie Provided" ist leer. --> Als Folge hieraus erhält man bei Data Provided ein 401 "Unauthorized" als Antwort.

Output nach "Test authentification":

Authentication | Return-Code Provided is: 200 Authentication | Login Successful Authentication | Cookie Provided is: Debug: | https://\<IP>:443/proxy/network/api/stat/sites UniFi API Call | Successfully Called UniFi API Call | Data Provided: 401 JSONData | 401

Brovning commented 2 years ago

Fehler gefunden: preg_match_all('|Set-Cookie: (.*);|U', substr($data, 0, $header_size), $results); Es wird Case-sensitive nach "Set-Cookie" gesucht. In meinem HTTP Header steht jedoch "set-cookie" in Kleinbuchstaben und somit wird das Cookie nicht gefunden.

Nötige Anpassung: preg_match_all('|(?i)Set-Cookie: (.*);|U', substr($data, 0, $header_size), $results); --> Case insensitive Mode = ON

Problem gelöst.

Brovning commented 2 years ago

Authentication failure handling improved: 92bb4be65dc91d79af2a7029af4922304a995aef

Brovning commented 2 years ago

Pull-request merged to beta. --> Closed