Left clicking link to /posts.rss does not work

Left clicking this link does not work for me (displays “Oops! That page doesn’t exist or is private.”), but middle clicking it or copying the URL works fine:

link to posts rss

I am using Chrome Version 49.0.2623.87 m on Windows 10.

4 Likes

This is the problem where URLs not defined in the Ember Router are assumed to be 404s.

5 Likes

I’ll check this. Give me a moment please.

I think i found the solution, but it was a little tricky to do it, the route is not being sent to the server, i made a whitelist checker to know if the route is internal or not, can you review this @zogstrip @codinghorror @sam? I can make a PR if you want to, this works actually.

  isInternalPathButNotEmber: function(path){
    return path.indexOf("posts.rss") >= 0
  },

  routeTo(path, opts) {
    if (Em.isEmpty(path)) { return; }

    if (Discourse.get('requiresRefresh') || this.isInternalPathButNotEmber(path)) {
      document.location.href = Discourse.getURL(path);
      return;
    }

The same problem happens for categories:

https://meta.discourse.org/c/bug.rss

Yes this is a rare bug, because the routes exists so, the problem is when the POST is sent to the server, is rejected and misinterpreted as a 404 error, but is not passing through Ember i think.

It’s hard for us to review some random code. It’s better if you do the PR and then we review :wink:

I made a PR actually but i closed it because it didn’t pass through travis, i make it again anyways?

Sure, don’t trust travis. Unless everything is red.

3 Likes

There you go :grin:

https://github.com/discourse/discourse/pull/4109

I made a groundwork for this, here is the PR updated:

https://github.com/discourse/discourse/pull/4109