serokell / hackage-search

An application that lets you search for anything on Hackage
https://hackage-search.serokell.io/
24 stars 0 forks source link

Slash issue #17

Closed int-index closed 3 years ago

int-index commented 3 years ago

https://www.reddit.com/r/haskell/comments/kdmzpd/comment/ggqj5mw

@phadej: "Strings with / (normal slash) seems to result into 404 error"

int-index commented 3 years ago

The only difference that I know of is that in the deployed service there's nginxin the middle:

    services.nginx.virtualHosts.hackage-search = {
      locations."/".proxyPass =
        if ! isNull cfg.socket
        then "http://unix:${cfg.socket}:/"
        else "http://localhost:${toString cfg.port}/";

      locations."/static/fonts/".alias = "${cfg.package}/fonts/";

But I don't know how to run the service locally to check if it's indeed the cause. @zhenyavinogradov Could you look into this? Thanks.

int-index commented 3 years ago

https://stackoverflow.com/questions/8264239/nginx-unescapes-2f-to-a-forward-slash-how-can-i-stop-it maybe?

zhenyavinogradov commented 3 years ago

Right, it's nginx replacing urlencoded characters with real ones, I'll see how we can fix it

zhenyavinogradov commented 3 years ago

You won't believe this one simple trick https://github.com/serokell/hackage-search/pull/19

int-index commented 3 years ago

Did it really help? https://hackage-search.serokell.io/?q=%2F still fails.

zhenyavinogradov commented 3 years ago

That fix is not deployed yet, the service is part of the system configuration, so we have to update it in the -infra repo: https://github.com/serokell/pegasus-infra/pull/11. I need a review from ops to deploy it.