Jump to content

Bug in Open Search URL parsing


Chris Messina
 Share

Recommended Posts

image.png.d839969917f7a8f5afa964a491a713b2.png

 

I've noticed that many OpenSearch providers (granted there aren't that many it seems) end up with HTML-encoded ampersands in the detected URL, for example:

 

http://camelcamelcamel.com/search?utm_campaign=osd&utm_source=chrome&utm_medium=www&q={query}

 

Alfred should not HTML-encoded ampersands, given that this is the actual URL in the Open Search definition:

 

<Url type="text/html" rel="results" template="http://camelcamelcamel.com/search?utm_campaign=osd&utm_source=chrome&utm_medium=www&q={searchTerms}"/>

 

 

Edited by chris
added URL to open search XML file
Link to comment
Share on other sites

2 hours ago, chris said:

Alfred should not HTML-encoded ampersands, given that this is the actual URL in the Open Search definition:

 



<Url type="text/html" rel="results" template="http://camelcamelcamel.com/search?utm_campaign=osd&utm_source=chrome&utm_medium=www&q={searchTerms}"/>

 

 

 

Alfred isn't encoding the URL. This is the actual raw source of the URL (after gzip decompression):

 


  <Url type="text/html"
    rel="results"
    template="http://camelcamelcamel.com/search?utm_campaign=osd&amp;utm_source=chrome&amp;utm_medium=www&amp;q={searchTerms}"/>

 

Whatever you're looking at the file in (your browser?) is showing you a processed version of the XML. Use something like curl or httpie to fetch XML/HTML if you want to see the raw source code.

Edited by deanishe
Link to comment
Share on other sites

Ah, weird! I suppose my browser is modifying the output there.

 

Well — perhaps if I were to rephrase my request: it would be nice if Alfred replaced the HTML-encoded ampersand with a naked ampersand.

 

It's a small change, but would be convenient for me if it were made, since I make the change manually now.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...