scottlamb / multipart-stream-rs

Rust library to parse and serialize async multipart/x-mixed-replace streams.
https://crates.io/crates/multipart-stream
Apache License 2.0
10 stars 8 forks source link

added support for camera live streams #2

Closed pkozelka closed 2 years ago

pkozelka commented 3 years ago

... with -- prefix already in the boundary header

This solves the situation when response comes with something like this:

HTTP/1.1 200 OK
Content-type: multipart/x-mixed-replace; boundary=--myboundary
...

and then the individual frame contains

--myboundary
Content-Type: image/jpeg
Content-Length: 11493
...

When the -- was added unconditionally, I got the message "bad boundary" because parser expected ----myboundary because I passed the boundary exactly as I received it from the response header.

scottlamb commented 2 years ago

Hey, I missed the email with this PR coming in. Sorry about that. (Does github have a dashboard of all your PRs across repos somewhere? I rarely glance at this repo since I haven't needed to make changes to it.)

I'm merging, better late than never. Out of curiosity, what make/model camera sends the content type like that?

pkozelka commented 2 years ago

Hi Scott, it was Sony SNC-EB640