Pull the regex matching into a seperate funtion as having the duplication is doing my head in!
Set the headers on the Response object

This means we can get rid of the spy methods too
Cold feet on removing the slightly more performant foreach in dispatch()