summaryrefslogtreecommitdiff
path: root/lib/SlackBuild/URI.pm
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2017-11-26 21:20:52 +0100
committerSergey Poznyakoff <gray@gnu.org.ua>2017-11-26 21:20:52 +0100
commit2f104feb62d8c9a6c27c0090a310afeefff4af09 (patch)
treebb358f5ac0d85da6185db5b0d51e67e7b4e49dba /lib/SlackBuild/URI.pm
parent0150f4a7597a8eb490d0fb8ddf63b92e154e489d (diff)
downloadslackbuilder-2f104feb62d8c9a6c27c0090a310afeefff4af09.tar.gz
slackbuilder-2f104feb62d8c9a6c27c0090a310afeefff4af09.tar.bz2
Use content type of the downloaded resource to select the backend for its handling
* lib/SlackBuild/Archive/Extractor.pm (_backend): Use archive->downloaded_html to select the backend. * lib/SlackBuild/Archive/Extractor/HTTP.pm (extract): Use $uri->downloaded_html instead of is_html. (is_html): Remove. * lib/SlackBuild/URI.pm (downloaded_html): New method.
Diffstat (limited to 'lib/SlackBuild/URI.pm')
-rw-r--r--lib/SlackBuild/URI.pm7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/SlackBuild/URI.pm b/lib/SlackBuild/URI.pm
index adaeca4..60b6b26 100644
--- a/lib/SlackBuild/URI.pm
+++ b/lib/SlackBuild/URI.pm
@@ -87,5 +87,10 @@ sub download_status {
my $self = shift;
return $self->download_response->status_line;
}
-
+
+sub downloaded_html {
+ my $self = shift;
+ return $self->download_response->content_type =~ m{^(?:application/xhtml\+xml|text/(?:css|html))$};
+}
+
1;

Return to:

Send suggestions and report system problems to the System administrator.