libreant
libreant copied to clipboard
opensearch mimetype
@boyska are you really sure that the mime-type of the opensearch results is correct ? https://github.com/insomnia-lab/libreant/blob/master/webant/webant.py#L78
( same code in agherant.py )
This is a tricky question, but I'll try to answer!
First of all, I think you noticed the misalignment: sometimes application/rss+xml
is used, while other times text/xml
is used. text/xml
should always be used, but the opensearch library has a bug about it ( edsu/opensearch#6 ). In b746e3b I make clear that using application/rss+xml
is just a way to workaround it.
I filed the bug (edsu/opensearch#6 ), proposed a VERY SIMPLE patch that fixes it (edsu/opensearch#7), and also tried to contact the author (@edsu) personally. No answer received.
Back to your question: text/xml
is technically correct (xml has more than one valid mimetype, depending on the intended usage of it) and has the advantage that browsers will display it in a nice way (because of the text/
prefix, I suppose).
Oke. I followed the issue on the library repo, but I did not really understood the point at that time. Now it's clear.
But i have a dubt:
Now we use text/xml
as the response mime if the client make a request with the header Accept: application/opensearchdescription+xml
isn't a wired behaviour ?
yes.
But even being coherent on doing crazy workaround on silly bugs would be quite wierd.