Header escaping

@rcrichton if you could please review?