mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-24 11:16:51 +00:00
Merge pull request #2778 from MilhouseVH/le90_distro_tool_octet_stream
distro-tool: handle binary/octet-stream HEAD responses
This commit is contained in:
commit
226395f257
@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
################################################################################
|
||||
# This file is part of LibreELEC - https://libreelec.tv
|
||||
# Copyright (C) 2016 Team LibreELEC
|
||||
# Copyright (C) 2016-present Team LibreELEC
|
||||
#
|
||||
# LibreELEC is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@ -307,8 +307,11 @@ class MyUtility(object):
|
||||
# A content_type of "text/html" indicates we were served an error page of
|
||||
# some kind (eg. iperf) and not the requested file, which would be "application/<something>".
|
||||
# "text/plain" indicates a misconfigured server (eg. libgcrypt, libgpg-error) so accept this.
|
||||
# Some servers (eg. files.pythonhosted.org) will respond with "binary/octet-stream".
|
||||
if http_code in ["200", "206"] or MyUtility.search_HTTP_OK.search(headers):
|
||||
result = True if (content_type.startswith("application/") or content_type.startswith("text/plain")) else False
|
||||
result = True if (content_type.startswith("application/") or \
|
||||
content_type.startswith("text/plain") or \
|
||||
content_type.startswith("binary/octet-stream")) else False
|
||||
elif http_code == "350" and url.startswith("ftp:"):
|
||||
result = True
|
||||
else:
|
||||
|
Loading…
x
Reference in New Issue
Block a user