Changeset 380


Ignore:
Timestamp:
Jun 10, 2004, 11:25:32 PM (18 years ago)
Author:
kake
Message:

Ensure RDF has content-type of text/plain.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/OpenGuides.pm

    r379 r380  
    454454                        vars     => $args{tt_vars},
    455455    );
    456     $output_conf{content_type} = $args{content_type} if $args{content_type};
    457     return OpenGuides::Template->output( %output_conf );
     456    if ( $args{content_type} ) {
     457        $output_conf{content_type} = "";
     458        my $output = "Content-Type: $args{content_type}\n\n"
     459                     . OpenGuides::Template->output( %output_conf );
     460    } else {
     461        return OpenGuides::Template->output( %output_conf );
     462    }
    458463}
    459464
  • trunk/t/53_show_index.t

    r379 r380  
    33use Config::Tiny;
    44use OpenGuides;
    5 use Test::More tests => 3;
     5use Test::More tests => 4;
    66
    77eval { require DBD::SQLite; };
     
    99
    1010SKIP: {
    11     skip "DBD::SQLite not installed - no database to test with", 3
     11    skip "DBD::SQLite not installed - no database to test with", 4
    1212      unless $have_sqlite;
    1313
     
    4242    };
    4343    is( $@, "", "->show_index doesn't die" );
     44    $output = $guide->show_index(
     45                                  type          => "category",
     46                                  value         => "Alpha",
     47                                  return_output => 1,
     48                                  format        => "rdf"
     49                                );
     50    like( $output, qr|Content-Type: text/plain|,
     51          "RDF output gets content-type of text/plain" );
    4452}
Note: See TracChangeset for help on using the changeset viewer.