4

I'm trying to set up a feed in a chat room. The URL has a query parameter, and I tried to stay close to what is allowed in the OData specification.

It turns out that SE chat is a bit more restrictive. For example, this URL:

https://lackadaisical-appeal.glitch.me/hnq/+?filter=tags contains 'number'

does get posted correctly to the chat web server:

feedUrl=https%3A%2F%2Flackadaisical-appeal.glitch.me%2Fhnq%2F%2B%3Ffilter%3Dtags+contains+%27number%27

but when the server returns the response page, the URL is reduced to:

https://lackadaisical-appeal.glitch.me/hnq/+?filter=tagscontainsnumber

This is not a visual glitch as on my server as I see calls being done with tagscontainsnumber, so this is what ended up being stored as URL for the SE chat bot to use.

I've found that I can work around this issue by doing the URL encoding upfront:

https://lackadaisical-appeal.glitch.me/hnq/+?filter=tags%20contains%20%27number%27

which does give me a feed with the applied filter:

click the image to jump to the chat message. This image shows: chat message: rene has made a change to the feeds
chat message: rene has made a change to the feeds
chat message: one box of a question on codegolf with the tag number

I'm not sure why the URL needs to go through this sanitizing step on the chat server, specially if the URL itself doesn't seem to be causing problems or being blocked when using the workaround.

I know Feed URLs are restricted on length and Feeds do have encoding weirdness but this is only slightly related.

For now I'm going to tag this as both and as I expect this to be . I propose to consider three options and request one to be selected and implemented:

  • Add a warning / error message if you enter "illegal" characters in the feedUrl field
  • URL Encode the feedUrl before it is posted to the server
  • Do not sanitize the URL on the server.

If none of these can or will be implemented, I'll accept an answer that shares the implementation details so that it is less of a surprise what happens.

You must log in to answer this question.

Browse other questions tagged .