nettigo / namf

Nettigo Air Monitor Firmware
GNU General Public License v3.0
33 stars 19 forks source link

Wrong content type for `config.json` endpoint #42

Closed bieniu closed 3 years ago

bieniu commented 3 years ago

Endpoint /config.json returns json data but the content type of the answer is text/plain, not application/json. Firmware: NAMF-2020-40

$ curl -v http://user:pass@192.168.1.99/config.json
*   Trying 192.168.1.99:80...
* Connected to 192.168.1.99 (192.168.1.99) port 80 (#0)
* Server auth using Basic with user 'user'
> GET /config.json HTTP/1.1
> Host: 192.168.1.99
> Authorization: Basic kDFjaBNrOmghYXRhLTk8lw==
> User-Agent: curl/7.74.0
> Accept: */*
> 
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Content-Type: text/plain     <-------------------------------------------------
< Content-Length: 1236
< Connection: close
< 
{"current_lang":"PL","SOFTWARE_VERSION":"NAMF-2020-40","wlanssid":"SSID","wlanpwd":"***","www_username":"user","www_password":"pass","fs_ssid":"NAM-16066574","fs_pwd":"","www_basicauth_enabled":"true","dht_read":"false","pms_read":"false","ds18b20_read":"false","gps_read":"false","send2dusti":"false","ssl_dusti":"false","send2madavi":"false","ssl_madavi":"false","send2sensemap":"false","send2fsapp":"false","send2lora":"false","send2csv":"false","auto_update":"false","update_channel":"2","has_display":"false","has_lcd1602":"false","has_lcd1602_27":"false","has_lcd2004_27":"false","has_lcd2004_3f":"false","show_wifi_info":"false","has_ledbar_32":"false","debug":"3","sending_intervall_ms":"145000","time_for_wifi_config":"600000","outputPower":"20.50","phyMode":"3","senseboxid":"6075a03aa81682001b533a6f","send2custom":"false","host_custom":"","url_custom":"","port_custom":"443","user_custom":"","pwd_custom":"","send2influx":"false","host_influx":"","url_influx":"","port_influx":"8086","user_influx":"","p* Closing connection 0
wd_influx":"","sensors":{"SPS30":{"e":0,"refresh":"10"},"NTW_WTD":{"e":1,"ip":"192.168.2.15"},"SHT3x":{"e":0,"d":0},"MHZ14A":{"e":0},"SDS011":{"e":1,"d":1},"HECA":{"e":1,"d":1},"BMPx80":{"e":0},"BME280":{"e":1}}}
netmaniac commented 3 years ago

Fixed in current beta branch. On update server in few hours.