# Redirect Handling `urllib.request.urlopen()` supports redirect handling automatically via a redirect handler class, which will handle an HTTP 301/302 error code and look for a `location` header. > [!NOTE] Beware of header post-normalization checks > This specifically looks for `location`, not `Location`. The `urllib` codebase will normalize headers by default, but if you're mocking a response, it's important to inject only normalized headers if you want this to work.