Added check for HTTP HEAD to prevent secondary requests from circumventing the extension's processing.