Middleware static - Properly merge options, allow getOnly to be configured. #482

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
4 participants

Pretty small change, but I needed getOnly to be false on a recent project, and found that it was hard coded to true. Fixed up options merging and made getOnly configurable.

Member

tj commented Feb 28, 2012

for what? POSTing to a static file etc is kinda weird

Yeah, I agree it sounds dumb, but we're using some static JSON files as "fixtures" for the unit tests on our framework. So our unit tests would attempt to POST to the static JSON file which would emulate a restful update. No big deal if you dont want to merge it in, but there was still a bug in the way options were being merged, so that's fixed too.

balnagy commented Jul 6, 2012

@visionmedia, this fix would be benefical for handling Facebook Canvas authentication, where OAuth tokens come in POST but you should render the page as well, which could be a static file (e.g. with client side mvc)

https://developers.facebook.com/docs/authentication/canvas/

I'd like to highlight this issue again. I'm trying to set up headless unit tests using PhantomJS for CanJS, but they're failing because we can't use our fixtures with Connect. All I'm asking is that connect acts like other server software where posting to a static file still loads the static file. I dont want to have to comment out lines every time I set up the project. Thanks.

Member

tj commented Jul 20, 2012

it's been broken down into https://github.com/visionmedia/send so now you can do whatever you want, if you're using express there's res.sendfile() which is the same thing with a nicer api

Contributor

jonathanong commented Oct 22, 2013

way old. probably belongs in https://github.com/visionmedia/send now if anything

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment