text=T(_("Insecure HTTPS → HTTP downgrade attempted by redirect from:\n\n'%1'\n\nto\n\n'%2'.\n\nPlease inform the server administrator that many clients disallow this because it could be a downgrade attack."),BD.url(item_url),BD.url(headers.location)),
icon="notice-warning",
})
elseifcode==401then
UIManager:show(InfoMessage:new{
text=T(_("Authentication required for catalog. Please add a username and password.")),
@ -559,10 +564,10 @@ function OPDSBrowser:downloadFile(item, format, remote_url)
localparsed=url.parse(remote_url)
http.TIMEOUT=20
localdummy,c=nil
localdummy,code,headers
ifparsed.scheme=="http"then
dummy,c=http.request{
dummy,code,headers=http.request{
url=remote_url,
sink=ltn12.sink.file(io.open(local_path,"w")),
user=item.username,
@ -571,7 +576,7 @@ function OPDSBrowser:downloadFile(item, format, remote_url)
text=T(_("Insecure HTTPS → HTTP downgrade attempted by redirect from:\n\n'%1'\n\nto\n\n'%2'.\n\nPlease inform the server administrator that many clients disallow this because it could be a downgrade attack."),BD.url(remote_url),BD.url(headers.location)),
icon="notice-warning",
})
else
util.removeFile(local_path)
UIManager:show(InfoMessage:new{
text=_("Could not save file to:\n")..BD.filepath(local_path),