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

Headers config (programmatic) #72

Closed eins78 closed 8 years ago

eins78 commented 8 years ago

Add custom headers (not just CORS) when using canned programmatically.

Note that any given headers are overriding whatever canned figured out internally (e.g. ‘Content-Type), my use case for that is serving a custom “JSON dialect” without adding the config via comments to every single file.

Did a slight refactoring of the internal handling to make that easier.

Not added to CLI options because not sure about naming.

eins78 commented 8 years ago

Well, I just figured out that the "overriding" I described above breaks my own use case, because there are other Content-Types than JSON involved. This needs some more thinking…

sideshowcoder commented 8 years ago

If you can come up with something let me know happy to help out if possible.