to use format from request if it was set
Fix CS and add test
Merge pull request #866 from urville/master

to use format from request if it was set