chrivers / bifrost

Hue Bridge Emulator
GNU General Public License v3.0
119 stars 5 forks source link

Expected request with `Content-Type: application/json` #25

Closed Flavien closed 1 month ago

Flavien commented 1 month ago

Trying to connect using Hue Essentials on Android, I get an error and this in the logs:

bifrost  |  2024-09-04T21:04:45.980Z INFO  bifrost::server                > http; method=POST uri=https://192.168.1.100/api
bifrost  |  2024-09-04T21:04:45.980Z TRACE axum::rejection                > rejecting request status=415 body="Expected request with `Content-Type: application/json`" rejection_type="axum::extract::rejection::MissingJsonContentType"
bifrost  |  2024-09-04T21:04:45.981Z INFO  bifrost::server                > http; status=415 Unsupported Media Type

Am I doing something wrong, or is something misconfigured?

chrivers commented 1 month ago

Ah, you found a sharp edge :)

Hue Essentials is (apparently) making the POST request with no regard for setting the "Content-Type" header.

It could well be argued that this is a bug in Hue Essentials (it is), but I realize that's a very unsatisfactory answer for Bifrost users..

I'll see if I can make a workaround, so we can support even these rough requests from Hue Essentials :wink: