ndmitchell / hoogle

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

[#123] Fix search plugin setup. #233

Closed daskol closed 6 years ago

daskol commented 6 years ago

Here I fix search plugin installation. It It did not work correctly since URI to OpenSearch descriptor and prefix URl were concatenated in wrong way. The conditions to add prefix to URI is a bit messy so here I provide some details about issue. There are a three kinds of URLs they are

  1. schemafull URLs like https://hoohle.haskell.org/some/uri/here (:// is in)
  2. schemaless URLs like //git.dsn/some/uri/here (// is the prefix)
  3. URI string like /res/search.xml or res/search.xml?domain=...

So we should check that the first and the senсond conditions are false simultaneously. If the last one statement correct then we should concatenate URL prefix and URI string.

ndmitchell commented 6 years ago

Thanks! Good catch!

Let me know if you want a release made incorporating this change to Hackage, or if it was just for the main website (if so, it will get deployed automatically in the next couple of hours).