fix(headers): bug when retrieving empty header

When trimming left, the reached character was assumed to not be
the end ('\0') of the string.