Glimpse / Home

Project Glimpse: Node Edition - Spend less time debugging and more time developing.
http://node.getglimpse.com
Other
252 stars 9 forks source link

[Middleware] Setting a response content type from a non-terminating middleware seems to disable assets filtering #52

Closed lostintangent closed 7 years ago

lostintangent commented 8 years ago

Repro steps:

  1. Add a call to res.type(".html") to a non-terminating middleware (i.e. one thats calls next()), assuming that the terminating middleware is calling res.render.
  2. Run the app to execute the above changes
  3. Open up the Glimpse client and select the respective request

Expected: To just see the request for the root document Actual: I see requests for CSS and JS files as well

requests

If I removed the call to res.type, and re-run the app, then everything displays in Glimpse as expected. This issue is pretty bizarre, and probably low-pri, but it's an example of how the filtering logic seems to get tripped up in some scenario, that an app could get into pretty easily.

avanderhoorn commented 8 years ago

@philliphoff This may have been fixed by some of the latter header tracking work you did? It it did we should confirm the fix or fix this up. I suspect that the issue is that .type(".html") isn't adding/setting the content type header into the headers list.

philliphoff commented 8 years ago

While I have yet to reproduce this particular issue with the latest bits (v0.15.2), I did find another issue where the HUD wasn't being injected when using res.type('.html'), due to it generating a "complex" Content-Type header that the HUD injection component does not properly parse. That's filed as Glimpse.Node#644;

avanderhoorn commented 8 years ago

If it turns out that this might have been fixed, lets close this off once we are sure.

avanderhoorn commented 8 years ago

p.s. good find on Glimpse.Node#644.

mike-kaufman commented 7 years ago

I'm unable to repro this on current bits. @lostintangent - if this still repros for you, could you include a zip of a small project that repros the problem?