When I try to download a file with AFDownloadRequestOperation from a URL, the Wi-fi router turns off internet connection and redirects me to an authorization page. The download process does not stop during this redirection and I get an HTML redirection page instead of a file that was supposed to be downloaded. It tells me that it's okay and that the file is downloaded.
How can I determine that a download object is an html redirection page and stop downloading it before I get that page?