yesodweb / yesod

A RESTful Haskell web framework built on WAI.
http://www.yesodweb.com/
MIT License
2.64k stars 374 forks source link

Yesod Devel shouldn't return HTML for non-HTML requests. #1407

Open iand675 opened 7 years ago

iand675 commented 7 years ago

I've got frontend code that is ignorant of Yesod devel & makes JSON requests. When it does so during yesod-devel's compilation phase, yesod-devel returns HTML, which causes the requests to fail.

I think ideally yesod-devel should accept the requests but delay actually returning content until compilation has finished and the app is able to handle responding again.

snoyberg commented 7 years ago

Seems OK to me. Want to try out a PR for that? It should be a relatively isolated change.

On Wed, Jun 14, 2017 at 9:40 AM, Ian Duncan notifications@github.com wrote:

I've got frontend code that is ignorant of Yesod devel & makes JSON requests. When it does so during yesod-devel's compilation phase, yesod-devel returns HTML, which causes the requests to fail.

I think ideally yesod-devel should accept the requests but delay actually returning content until compilation has finished and the app is able to handle responding again.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/yesodweb/yesod/issues/1407, or mute the thread https://github.com/notifications/unsubscribe-auth/AADBBwnK88J2pJhPjOvDMcqgkdg4ZFL6ks5sD4BjgaJpZM4N5chb .