Fixed encoding bug in HTTP request processing, causing weird flask issues
Fixed encoding bug in HTTP request processing, causing weird flask issues

If a content type header was present on a multipart form data part it would turn
the rewritten body into a unicode instead of a byte array, causing a later conversion
to a byte stream to not capture.

Fixed both the fact that the rewritten body would turn into unicode by making
sure the content type header was provided as byte array and fixed the byte stream
conversion to also trigger on unicode instances.

Solves #1531

JackGavin13/octoprint-test-not-finished,shohei/Octoprint,beeverycreative/BEEweb,Salandora/OctoPrint,shohei/Octoprint,Salandora/OctoPrint,Jaesin/OctoPrint,MoonshineSG/OctoPrint,ryanneufeld/OctoPrint,MoonshineSG/OctoPrint,senttech/OctoPrint,foosel/OctoPrint,bicephale/OctoPrint,senttech/OctoPrint,nickverschoor/OctoPrint,bicephale/OctoPrint,JackGavin13/octoprint-test-not-finished,nickverschoor/OctoPrint,nickverschoor/OctoPrint,JackGavin13/octoprint-test-not-finished,beeverycreative/BEEweb,ryanneufeld/OctoPrint,shohei/Octoprint,senttech/OctoPrint,foosel/OctoPrint,ryanneufeld/OctoPrint,bicephale/OctoPrint,senttech/OctoPrint,bicephale/OctoPrint,beeverycreative/BEEweb,Jaesin/OctoPrint,shohei/Octoprint,Jaesin/OctoPrint,nickverschoor/OctoPrint,foosel/OctoPrint,shohei/Octoprint,Salandora/OctoPrint,MoonshineSG/OctoPrint,foosel/OctoPrint,Jaesin/OctoPrint,Salandora/OctoPrint,JackGavin13/octoprint-test-not-finished,MoonshineSG/OctoPrint,ryanneufeld/OctoPrint,beeverycreative/BEEweb