Skip to content
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

Serving binary files broken? #142

Open
miminno opened this issue Oct 14, 2014 · 10 comments
Open

Serving binary files broken? #142

miminno opened this issue Oct 14, 2014 · 10 comments

Comments

@miminno
Copy link

miminno commented Oct 14, 2014

When using connect to serve binary files (pdf's) they show up in the browser as broken.
The content length is reported wrong too (2.5Kb of the real file vs 3.9Kb in the browser).

@misja-alma
Copy link

Looks like the same issue I'm having (issue #145). The character encoding is somehow changed to UTF-8, which explains why the file has grown in size.

@chrstr
Copy link

chrstr commented Feb 9, 2015

Looks like this was broken recently. If I revert my dependency to 0.8.0 this is working again for me. It's broken on 0.9.0.

@michi88
Copy link

michi88 commented Feb 25, 2015

0.8.0 is not working for me (at least together with https://github.com/drewzboto/grunt-connect-proxy)

This is the diff: 31fb2b2...master#diff-d0f77dfe96c2eba118cfc72926282b01

I also don't see what changed that could have caused this.

@pswai
Copy link

pswai commented Mar 30, 2015

Reverting to 0.8.0 works for me. In my case, I was having problem with loading applets.

@eekboom
Copy link

eekboom commented Oct 6, 2015

For me, too downgrading to 0.8.0 fixes the issue, too.
Unfortunately I am much too busy with testing and release preparation for me to have a deeper look at the issue :-(

@eekboom
Copy link

eekboom commented Oct 6, 2015

Ok, after spending quite some time I found that the bug is in connect-livereload, and it is already known:

intesso/connect-livereload#39

@dkobozev
Copy link

It does look like it's an issue with connect-livereload, but the thread linked by @eekboom mentions a workaround in the form of adding an ignore: ['.pdf'] option. I couldn't figure out how to pass that option to connect-livereload from my Gruntfile, so I had to disable livereloading completely.

@treejanitor
Copy link

I was actually able to do it in my express config... I'm using a reasonably new angular-fullstack version for the root of the grunt set up. For whatever reason, I didn't have to do it in my Gruntfile.

I'm not sure the disabling of compression is required, but I did it to as a way to make sure I could completely valid byte counts along the wire...

in my /server/config/express.js config set up using angular-fullstack

  if ('development' === env) {
    app.use(require('connect-livereload')({
      ignore: [/\.pdf(\?.*)?$/, /\.zip(\?.*)?$/],
      disableCompression: true
    }));
  }

Very very frustrating issue to debug, for me, anyway, particularly because zip files were not mentioned as issues in people's comments and they change size to begin with after compression.

@bartolomeon
Copy link

@dkobozev I made a fork of grunt-contrib-connect and added an option to pass the 'ignore' option from Gruntfile to connect-livereload. It is for a latest version thought. Here it is: https://github.com/bartolomeon/grunt-contrib-connect (updated the README.md as well).
I'll make a PR for it, maybe it will get accepted :)

@halfmatthalfcat
Copy link

+1 this caused consistent CONTENT_MISMATCH_ERRORs in Chrome when livereload was used in middleware along with the mounted static files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants