rendrjs / rendr

Render your Backbone.js apps on the client and the server, using Node.js.
MIT License
4.09k stars 313 forks source link

Fetch timeout parameter gets filtered #480

Closed ErikLarsson82 closed 9 years ago

ErikLarsson82 commented 9 years ago

Hi,

I'm trying to implement standard timeout functionality when doing client requests.

So, passing options { timeout: 1337 } to app.fetch seems like a good idea.

The problem I have is that those options gets filtered in fetcher.js. In fact, the only option that gets passed to the actual fetch is headers.

Now, one simple modification and the timeout parameter gets passed all the way down the chain to the actual xhr request and I get the behaviour I expect. Line 178, fetcher.js -> timeout: options.timeout, //maybe a nullcheck here aswell

Is this a change that is in the pipeline? Or am I approaching the problem from some wrong angle? I'd love to provide a pull request if neccessary.

Thanks in advance ^_^

saponifi3d commented 9 years ago

:+1: i like your PR that you opened! thanks for the question, sorry i didn't get back to you in time before you answered it yourself. :)