diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2017-11-26 21:20:52 +0100 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2017-11-26 21:20:52 +0100 |
commit | 2f104feb62d8c9a6c27c0090a310afeefff4af09 (patch) | |
tree | bb358f5ac0d85da6185db5b0d51e67e7b4e49dba /lib/SlackBuild/URI.pm | |
parent | 0150f4a7597a8eb490d0fb8ddf63b92e154e489d (diff) | |
download | slackbuilder-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.pm | 7 |
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; |