Simply using setdefault should suffice rather than extend. This is crucial for custom protocol extensions where the Server / User-Agent headers is used to notify clients/servers about capabilities.