summaryrefslogtreecommitdiffstats
path: root/scripts/lib/ptxd_make_get.sh
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2017-11-29 10:44:29 +0100
committerMichael Olbrich <m.olbrich@pengutronix.de>2017-12-01 14:11:33 +0100
commitb45f382662c4b856ad25c04717b0d92040fddcd8 (patch)
treee59cbc7437c8e28d9d242b167d4054132bca1fec /scripts/lib/ptxd_make_get.sh
parentc8da55d752bfee4e6d8f5028fcc3b82399b76d86 (diff)
downloadptxdist-b45f382662c4b856ad25c04717b0d92040fddcd8.tar.gz
ptxdist-b45f382662c4b856ad25c04717b0d92040fddcd8.tar.xz
ptxd_make_get_http: improve html detection in urlcheck
* The content-type line may contain capital letters. * With redirects there may be multiple content-type lines. Only the last one counts. Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'scripts/lib/ptxd_make_get.sh')
-rw-r--r--scripts/lib/ptxd_make_get.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/lib/ptxd_make_get.sh b/scripts/lib/ptxd_make_get.sh
index 33b76c27b..70c99329a 100644
--- a/scripts/lib/ptxd_make_get.sh
+++ b/scripts/lib/ptxd_make_get.sh
@@ -98,7 +98,7 @@ ptxd_make_get_http() {
--head \
--request GET \
"${url}" &&
- if grep -q "content-type:text/html" "${temp_header}"; then
+ if grep -i "content-type:" "${temp_header}" | tail -n 1 | grep -q "text/html"; then
ptxd_bailout "Got HTML file"
fi
ptxd_make_serialize_put