kismetwireless / kismet-docs

Mirror of offical kismet-docs repo from kismetwireless.net
19 stars 14 forks source link

Rest API commands problem with provided Content-type header #36

Closed notaco closed 3 years ago

notaco commented 3 years ago

kismet version built from git master pulled last night

$ curl -H 'Content-Type: application/x-www-form-urlencoded; charset=utf-8' -d 'json={"name":"advcryptchange","text":"test alert 2"}' http://kismet:PASSWORD@127.0.0.1:2501/alerts/raise_alerts.cmd
Invalid request:  Unknown alert type ''
$ curl -H 'Content-Type: application/x-www-form-urlencoded' -d 'json={"name":"advcryptchange","text":"test alert"}' http://kismet:PASSWORD@127.0.0.1:2501/alerts/raise_alerts.cmd
Alert raised
kismetwireless commented 3 years ago

Thanks! Unfortunately the UTF-8 stuff is vital for some implementations to work at all. I'm actually going to fix this on the server side with commit f0c0ed875558476807df6f0ce7ff0ff24f52d0cd, which will do a case-insensitive match so it will accept utf-8 or UTF-8 now, which ought to handle it.

notaco commented 3 years ago

Makes sense charset was in the documents for a reason. I thought something might be up on server side since the recent change in the httpd used. I didn't think to check case sensitivity or dig through the kismet source. I see referenced commit and am glad to have pointed it out. Thanks!

kismetwireless commented 3 years ago

For sure, thanks - I'm sure it would have caused problems with something sooner than later too once the new webserver goes into release.