Dancer icon indicating copy to clipboard operation
Dancer copied to clipboard

Dancer::Plugin::Ajax affects routes that dont use the `ajax` keyword

Open throughnothing opened this issue 12 years ago • 3 comments

Because of the before hook it uses, it can alter the content_type response of even normal routes.

I ran across this issue when trying to get the raw html of one of my routes with a jQuery ajax request. The jQuery request was never having its success event fired, because the before hook in the Ajax plugin was detecting it as an ajax request and setting the content-type to text/xml instead of text/html as it should have.

I don't think this plugin should alter routes in this way unless they are routes created using the ajax keyword.

throughnothing avatar Jan 03 '13 01:01 throughnothing

+1

kevzettler avatar Jan 03 '13 01:01 kevzettler

Very good point. Could you open a bug against Dancer 2 for this? Thanks!

2013/1/3 Kev Zettler [email protected]

+1

— Reply to this email directly or view it on GitHubhttps://github.com/PerlDancer/Dancer/issues/879#issuecomment-11832787.

sukria avatar Jan 03 '13 09:01 sukria

Oh wait, I got puzzled by the GH email, I'll fork the issue.

sukria avatar Jan 03 '13 09:01 sukria