Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request titles containing slashes unsearchable #97

Open
ivybennett-ford opened this issue Sep 8, 2022 · 2 comments
Open

Request titles containing slashes unsearchable #97

ivybennett-ford opened this issue Sep 8, 2022 · 2 comments

Comments

@ivybennett-ford
Copy link

Bot tells me the search does not return a result when I query targets with slashes in the body. Have not started to fix this, logging it here so I don't forget.

I expect to be able to default to a slash-less prompt, but a successful search is apparently unsuccessful for the examples I've tried (Except for Face/Off lol)

Entering command again with previous result of same query displayed above
slash-command-log

For some reason going slashless works for this title, bot not others (specifically V/H/S. but also titles in this very helpful thread)
slash-command-log2

@domainzero
Copy link

domainzero commented Oct 21, 2022

This also happens with titles that contain an apostrophe, ' , so it probably happens with other escapable characters too.

@The-Running-Dev
Copy link
Contributor

Yup, just encountered this with a colon. The issue is utils.clj

(defn http-request [method url key & [params]]
  (let [chan (a/promise-chan)
        put (fn [v]
              (trace "HTTP Response " v)
              (a/put! chan v))]
    (trace "Performing HTTP request" method url params)
    (hc/request
     (deep-merge
      {:method method
       :url url
       :as :json-string-keys
       :coerce :always
       :async? true
       :headers {"X-API-Key" key}}
      params)
     put
     put)
    chan))

Query:

"http://192.168.20.20:5055/api/v1/search?query=Freeway: Crack in the System",

Response:

"Parameter 'query' must be url encoded. Its value may not contain reserved characters."}]}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants