-
-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update browser.ts #20
Conversation
Allow for multipart/x-mixed-replace and others.
Havent heard about this one, or others. I dont want to expose myself into inadvertently supporting other mime types I dont have any knowledge about. Can you please help me understand the implications of this change? Love to merge this, just with a tiny more clarity! |
It's used in many ip cameras.
The general payload looks like this
HTTP/1.1 200 OK
Content-Type: multipart/x-mixed-replace; boundary=myboundary
…--myboundary
Content-Type: image/jpeg
Content-length: 12345
[image 1 encoded jpeg data]
--myboundary
Content-Type: image/jpeg
Content-length: 45678
[image 2 encoded jpeg data]
...
In any case, your library should handle all multipart types. Not just one.
On Wed, May 24, 2023, 23:20 Marais Rossouw ***@***.***> wrote:
Havent heard about this one, or others. I dont want to expose myself into
inadvertently supporting other mime types I dont have any knowledge about.
Can you please help me understand the implications of this change? Love to
merge this, just with a tiny more clarity!
—
Reply to this email directly, view it on GitHub
<#20 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACTNCZ52SLI3K5CX7GMVHTXHZ3SDANCNFSM6AAAAAAYLO7LUE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Thanks so much for that insight @netbrain. No idea if meros would work with binary data, but doesnt seem entirely out there. Wondering actually if I should change my api to simply ignore the response header, and assume the developer knows what theyre doing and only calling into meros when they know the response will be a stream. Am i blocking you, or can you give me a moment to think about this? |
May be just allow to pass this as option, having the actual value as fallback. Something like |
Yeah that is just moving the branch inside meros, when it could be this in user land. fetch('..')
.then(req => {
if (req.headers['content-type'].includes('multipart/x-mixed-replace')) {
return meros(req);
}
return req.json();
}) all that meros cares about is a @artola does this change impact anything with HC/BCP? |
@maraisr No impact at HC/BCP. We write our network layer, and we will make it work anyway, to keep our users happy ;) |
Im going to land this. The |
Please check out v1.3.0 all released for you 🚀 |
Allow for multipart/x-mixed-replace and others.