Plack::MiddleWare::SimpleContentFilter throws warning on redirect. #376

Open
earino opened this Issue Feb 19, 2013 · 3 comments

Projects

None yet

2 participants

@earino
earino commented Feb 19, 2013

P::M::SCF triggers the following warning:

Use of uninitialized value in pattern match (m//) at [MY PATH]/local-lib/lib/perl5/Plack/Middleware/SimpleContentFilter.pm line 18.

This is being caused because our request object is simply:

[
301,
[
'Location',
'stuff to redirect to'
],
[]
]
];

So there is no Content-Type header to introspect.

@earino earino pushed a commit to earino/Plack that referenced this issue Feb 19, 2013
Eduardo Arino de la Rubia #376 - SimpleContentFilter throws warning when no content-type is pre…
…sent.
079404f
@miyagawa
Member

Content-Type is a required header in PSGI response per spec.

@earino
earino commented Feb 19, 2013

What is the appropriate content-type header for an HTTP 301?

@miyagawa
Member

You should be just able to use text/html for 301.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment