moustached-hubot
moustached-hubot copied to clipboard
Posting to statuspage.io now requires a Content-Type header
When trying to post a new status update today I received the error:
Error updating incident "_________": Content-Type header must be set for a POST request with a body.
CC: @statuspage, @scootklein
@scootklein @statuspage can you guys confirm that this is now a requirement?
apologies, just removed this constraint. i falsely assumed this header was always present as a function of the HTTP client sending it with all POST requests. I had debugged a couple issues with other customers where params weren't coming through to the Rails side of things, and adding the Content-Type header seemed to fix it.
can you confirm for me things are working again on your end? this constraint will be left off until i can further pin down exactly what the behavior is.
did some more digging on this. Rails will parse JSON encoded bodies into params even in the absence of a Content-Type header, but with form-encoded bodies it ignores the body outright if there is a blank Content-Type header.
sorry again for the trouble
I can certainly apply a patch to the hubot scripts to fix this though.
it couldn't hurt, but shouldn't be required. patching will just be certain to future-proof it