Patch für FHEMWEB: Nicht definiertes origin bei CORS

Begonnen von gandy, 23 Juli 2015, 21:52:26

Vorheriges Thema - Nächstes Thema

gandy

In einer meiner FHEMWEB Instanzen ist CORS aktiviert. Augenscheinlich definiert nicht jeder Client, der darauf zugreift, die entsprechenden Header, weswegen es zu reichlich Warnungen im Log kommt:

2015.07.23 18:36:15.708 1: PERL WARNING: Use of uninitialized value $origin[0] in concatenation (.) or string at /opt/fhem/FHEM/01_FHEMWEB.pm line 347.
2015.07.23 18:36:15.969 1: PERL WARNING: Use of uninitialized value $origin[0] in concatenation (.) or string at /opt/fhem/FHEM/01_FHEMWEB.pm line 347.
2015.07.23 18:36:16.277 1: PERL WARNING: Use of uninitialized value $origin[0] in concatenation (.) or string at /opt/fhem/FHEM/01_FHEMWEB.pm line 347.
2015.07.23 18:36:16.586 1: PERL WARNING: Use of uninitialized value $origin[0] in concatenation (.) or string at /opt/fhem/FHEM/01_FHEMWEB.pm line 347.
2015.07.23 18:36:16.893 1: PERL WARNING: Use of uninitialized value $origin[0] in concatenation (.) or string at /opt/fhem/FHEM/01_FHEMWEB.pm line 347.
2015.07.23 18:36:17.334 1: PERL WARNING: Use of uninitialized value $origin[0] in concatenation (.) or string at /opt/fhem/FHEM/01_FHEMWEB.pm line 347.


Der beigefügte Patch behebt das, Nebenwirkungen konnte ich nicht feststellen. Der Patch basiert auf "01_FHEMWEB.pm 8965 2015-07-14 13:56:38Z"

Grüße,
Andy.
fhem (svn) auf i5-4210U NUC
2x HMLAN, 19x HM-SEC-RHS, 15x HM-LC-Bl1PBU-FM, etc.
ODYS Neron Tablet / Android 4.2
Samsung Galaxy Tab 2 10.1N / Android 4.1.2
Samsung Galaxy Note / Android 6.0.1

rudolfkoenig

Patch akzeptiert, sobald sourceforge funktioniert, wird es eingecheckt.