ndmitchell / hoogle

Haskell API search engine
http://hoogle.haskell.org/
Other
738 stars 134 forks source link

Correct output semantics for the search server #201

Closed achudnov closed 7 years ago

achudnov commented 7 years ago

Fixes #200.

It looks like the code in Action.Server has bit-rotten and it wasn't using the correct types for output. It was using a plain OutputString whereas OutputHTML would have been more appropriate at it causes the web server to send the appropriate Content-Type. I've changed those, which fixed the issue with text-browsers that I was seeing.

I didn't touch the OutputString in the stats handler as I was not sure about the intended semantics of the output. It might be worth checking it and also searching for other occurrences of OutputString and checking if a more specific constructor (e.g. OutputHTML or OutputJSON) would be more appropriate.

ndmitchell commented 7 years ago

Thanks for the patch! I deleted OutputString and added in OutputText which sends things up with text/plain - now there is always a content-type specified.

achudnov commented 7 years ago

Thanks, Neil. Would you, please, comment here (or @-mention me somewhere else) when this fix is out on Hackage/Stackage?

ndmitchell commented 7 years ago

It's already deployed at http://hoogle.haskell.org/. Generally Stackage upgrades relatively rarely - if it makes a particular difference I can make a release and suggest they take it sooner.

achudnov commented 7 years ago

I meant the actual package. I run hoogle locally. It's not urgent: I've installed it from HEAD manually.

ndmitchell commented 7 years ago

I've just released hoogle-5.0.7 which has the fix it in - always happy to make a release if it's of benefit to someone.

achudnov commented 7 years ago

Thank you!