| 1 | # | ||
| 2 | # This file is part of Net-HTTP-Spore-Middleware-Header | ||
| 3 | # | ||
| 4 | # This software is copyright (c) 2014 by celogeek <me@celogeek.com>. | ||
| 5 | # | ||
| 6 | # This is free software; you can redistribute it and/or modify it under | ||
| 7 | # the same terms as the Perl 5 programming language system itself. | ||
| 8 | # | ||
| 9 | package Net::HTTP::Spore::Middleware::Header; | ||
| 10 | |||
| 11 | # ABSTRACT: Spore Middleware to add header on each request | ||
| 12 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 13 | 1 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 14 | 1 | our $VERSION = '0.03'; # VERSION | |
| 15 | |||
| 16 | 1 | ▶ | use Moose; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 17 | 1 | extends 'Net::HTTP::Spore::Middleware'; | |
| 18 | |||
| 19 | 1 | has 'header_name' => ( isa => 'Str', is => 'rw', required => 1 ); | |
| 20 | 1 | has 'header_value' => ( isa => 'Str', is => 'rw', required => 1 ); | |
| 21 | |||
| 22 | 0 | ▶ | sub call { |
|
Subroutine
call: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 23 | 0 | my ( $self, $req ) = @_; | |
| 24 | |||
| 25 | 0 | return $req->header( $self->header_name, $self->header_value ); | |
| 26 | } | ||
| 27 | 1 | 1; | |
| 28 | |||
| 29 | __END__ | ||