Disable same origin policy for json requests.

Ill suggest just cherry picking https://github.com/jamox/tmc-server/commit/1b29f15678f90cb401f5830ed915893361728dd6