sideshowcoder / canned

Server to respond with fake API responses, by using a directory of files for finding out what to say!
213 stars 46 forks source link

Restore httpObj.fname on each attempt to get a response, because as i… #68

Closed msurdi closed 8 years ago

msurdi commented 9 years ago

…t is passed by reference it suffers modifications down the call stack

msurdi commented 9 years ago

This isn't the cleanest fix, but solves the problem. I believe the right solution would be to not modify httpObj when you receive it as an argument, because that object is then passed around again several times. Instead it should be copied/cloned if needed, but thats a way bigger and time consuming change.

sideshowcoder commented 9 years ago

Yeah I agree not modifying is by far cleaner, but I'm fine with making it work first and iterate :+1:

sideshowcoder commented 9 years ago

I added you as a collaborator, so you can merge the fix if you like :) pull in the failing test from PR #67 and merge it :+1: