~ubuntu-branches/ubuntu/intrepid/libwww-perl/intrepid

« back to all changes in this revision

Viewing changes to lib/HTTP/Headers.pm

  • Committer: Bazaar Package Importer
  • Author(s): gregor herrmann
  • Date: 2008-04-16 16:36:16 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20080416163616-06kg47nxqi6xrwts
Tags: 5.812-1
New upstream release, fixes the SSL regression (closes: #476390).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
package HTTP::Headers;
2
2
 
3
 
# $Id: Headers.pm,v 1.64 2005/12/08 12:11:48 gisle Exp $
4
 
 
5
3
use strict;
6
4
use Carp ();
7
5
 
8
6
use vars qw($VERSION $TRANSLATE_UNDERSCORE);
9
 
$VERSION = sprintf("%d.%02d", q$Revision: 1.64 $ =~ /(\d+)\.(\d+)/);
 
7
$VERSION = "5.810";
10
8
 
11
9
# The $TRANSLATE_UNDERSCORE variable controls whether '_' can be used
12
10
# as a replacement for '-' in header field names.
260
258
    if (defined $time) {
261
259
        $self->_header($header, HTTP::Date::time2str($time));
262
260
    }
 
261
    $old =~ s/;.*// if defined($old);
263
262
    HTTP::Date::str2time($old);
264
263
}
265
264
 
292
291
  wantarray ? @ct : $ct[0];
293
292
}
294
293
 
 
294
sub _is_html          {
 
295
    my $self = shift;
 
296
    return $self->content_type eq 'text/html' || $self->_is_xhtml;
 
297
}
 
298
 
 
299
sub _is_xhtml         {
 
300
    my $ct = shift->content_type;
 
301
    for (qw(application/xhtml+xml application/vnd.wap.xhtml+xml)) {
 
302
        return 1 if $_ eq $ct;
 
303
    }
 
304
    return 0;
 
305
}
 
306
 
295
307
sub referer           {
296
308
    my $self = shift;
297
309
    if (@_ && $_[0] =~ /#/) {
529
541
=head1 CONVENIENCE METHODS
530
542
 
531
543
The most frequently used headers can also be accessed through the
532
 
following convenience methods.  These methods can both be used to read
 
544
following convenience Methods.  These methods can both be used to read
533
545
and to set the value of a header.  The header value is set if you pass
534
546
an argument to the method.  The old header value is always returned.
535
547
If the given header did not exist then C<undef> is returned.