`isinstance()` is better than `type()` (http://stackoverflow.com/questions/1549801/differences-between-isinstance-and-type-in-python)
To accept unicode and normal strings you can use `isinstance(header, string_types)`