From 24c30fae21e38b8632cbf70b8a8d5fc3f5e57394 Mon Sep 17 00:00:00 2001 From: Andreas Granig Date: Wed, 6 Aug 2014 22:06:21 +0200 Subject: [PATCH] MT#8507 Remove libdigest-sha3-perl dependency. The code was commented out anyways, so it's just removed entirely. --- debian/control | 1 - lib/NGCP/Panel/Role/API.pm | 40 -------------------------------------- 2 files changed, 41 deletions(-) diff --git a/debian/control b/debian/control index 64f596cf41..35e0338132 100644 --- a/debian/control +++ b/debian/control @@ -102,7 +102,6 @@ Depends: gettext, libdatetime-format-rfc3339-perl, libdatetime-perl, libdbix-class-resultset-recursiveupdate-perl (>= 0.30~), - libdigest-sha3-perl, libemail-mime-perl, libemail-send-perl, libemail-sender-perl, diff --git a/lib/NGCP/Panel/Role/API.pm b/lib/NGCP/Panel/Role/API.pm index d12496dca8..f23c74637b 100644 --- a/lib/NGCP/Panel/Role/API.pm +++ b/lib/NGCP/Panel/Role/API.pm @@ -270,46 +270,6 @@ sub require_wellformed_json { return $ret; } -=pod -# don't use caching for now, keep it as simple as possible -sub cached { - my ($self, $c) = @_; - my $response = $c->cache->get($c->request->uri->canonical->as_string); - unless ($response) { - $c->log->info('not cached'); - return; - } - my $matched_tag = $c->request->header('If-None-Match') && ('*' eq $c->request->header('If-None-Match')) - || (grep {$response->header('ETag') eq $_} Data::Record->new({ - split => qr/\s*,\s*/, unless => $RE{delimited}{-delim => q(")}, - })->records($c->request->header('If-None-Match'))); - my $not_modified = $c->request->header('If-Modified-Since') - && !($self->last_modified < DateTime::Format::HTTP->parse_datetime($c->request->header('If-Modified-Since'))); - if ( - $matched_tag && $not_modified - || $matched_tag - || $not_modified - ) { - $c->response->status(HTTP_NOT_MODIFIED); - $c->response->headers($response->headers); - $c->log->info('cached'); - return 1; - } - $c->log->info('stale'); - return; -} - -sub etag { - my ($self, $octets) = @_; - return sprintf '"ni:/sha3-256;%s"', sha3_256_base64($octets); -} - -sub expires { - my ($self) = @_; - return DateTime->now->clone->add(years => 1); # XXX insert product end-of-life -} -=cut - sub allowed_methods { my ($self) = @_; my $meta = $self->meta;