Do not redirect if the response is already committed.
Remove unused import.
Fix header.