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

Bugfix/58 complex responses same file #59

Closed kevinschumacher closed 9 years ago

kevinschumacher commented 9 years ago

(Partially) addresses issue #58 - addresses the main complaint but maybe not in the best way.

This adds a few extra characters to the regex in Canned.prototype.getEachResponse() such that responses containing apostrophes, hash marks, parentheses, ampersands, and carats are captured correctly.

The regex in Canned.prototype.getEachResponse is brittle - a future iteration might just split where '//!' starts a line.

sideshowcoder commented 9 years ago

Thanks so much for looking into this, only one thing any reason why your are not going to splitting at //! right now? or even better \n//! this seems like a hightly unlikely sequence to appear in a params hash so it seems like a perfect solution. :+1:

kevinschumacher commented 9 years ago

Could only handle so much javascript in one day...

Made the change, but closing this because I have to rewrite the branch's history. Will open new PR with fix.

sideshowcoder commented 9 years ago

Hehe awesome thank you!