package RSApache::Response::HTML;

use strict;
use warnings;

use IO::File;
use Apache2::Const qw(OK);

use lib '/app/tools/common/lib';
use RSApache::Response;
use base 'RSApache::Response';

sub _init {
    my ( $self, $html ) = @_;

    $self->{html} = $html;
}

sub respond {
    my ( $self, $apache ) = @_;

    $apache->content_type("text/html");

    $apache->err_header_out( 'Pragma'        => 'no-cache' );
    $apache->err_header_out( 'Cache-control' => 'no-cache' );

    my $fh = IO::File->new( $self->{html} ) || die "ERROR - unable to open " . $self->{html} . " for reading: $!";

    $apache->send_fd($fh);
    close($fh);

    return OK;
}

###
1;    # Play nicely.
###

