webpack-hot-middleware icon indicating copy to clipboard operation
webpack-hot-middleware copied to clipboard

Fixed win10 cannot handle EventSource Response

Open max918 opened this issue 6 years ago • 2 comments

This PR contains a:

  • [x] bugfix
  • [ ] new feature
  • [ ] code refactor
  • [ ] test update
  • [ ] typo fix
  • [ ] metadata update

Motivation / Use-Case

on Window 10, browsers would not process (or cannot handle) the EventSource's HTTP response if the response is without 'Content-Length'. It cause the client.js cannot be notified to update frontend changes.

But hot-middleware is using the streaming data approach to achieve eventsource. So, adding the Response Header 'Content-Length: -1' can solve the problem.

The fix is already tested on Chrome browser of window 10 (64 bit) and Mac OS.

https://github.com/webpack-contrib/webpack-hot-middleware/issues/101

Breaking Changes

Additional Info

max918 avatar Apr 12 '19 08:04 max918

CLA assistant check
All committers have signed the CLA.

jsf-clabot avatar Apr 12 '19 08:04 jsf-clabot

Can you create minimum reproducible test repo, adding this header is breaking change and break logic for other types

alexander-akait avatar Apr 12 '19 10:04 alexander-akait