Patch Controller to send headers properly, and fix JS CDN scheme

No one-line if statements please.