Moxy::Plugin::XMLisHTML - XML is HTML


Moxy documentation Contained in the Moxy distribution.

Index


Code Index:

NAME

Top

Moxy::Plugin::XMLisHTML - XML is HTML

SYNOPSIS

Top

    - module: XMLisHTML

DESCRIPTION

Top

If you want to use the CSS, DoCoMo UA needs to use 'application/xhtml+xml' for Content-Type. But, DoCoMo's XHTML is not valid, likes '<a href="/login" utn>login</a>', Firefox reject this... orz.

This plugin replace Content-Type header.

AUTHORS

Top

Tokuhiro Matsuno

SEE ALSO

Top

Moxy


Moxy documentation Contained in the Moxy distribution.

package Moxy::Plugin::XMLisHTML;
use strict;
use warnings;
use base qw/Moxy::Plugin/;

sub response_filter :Hook {
    my ($self, $context, $args) = @_;
    $args->{response}->header( 'Content-Type' => 'text/html' ) if $args->{response}->header( 'Content-Type' ) =~ /xml/;
}

1;
__END__