Hapi does something weird whenever there's an error and the response becomes a Hapi Boom object instead of a Hapi Response. That causes an annoying issue where there's two different ways to set the response header. This adds some guards and sets the header for the error case.
Hapi does something weird whenever there's an error and the response becomes a Hapi Boom object instead of a Hapi Response. That causes an annoying issue where there's two different ways to set the response header. This adds some guards and sets the header for the error case.