# GET /posts/ request got plain HTTP error

**URL:** https://meta.discourse.org/t/get-posts-request-got-plain-http-error/279552
**Category:** UX
**Tags:** pr-welcome
**Created:** [September 20, 2023, 6:46am UTC](https://meta.discourse.org/t/get-posts-request-got-plain-http-error/279552 "2023-09-20T06:46:48Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![Hyan](https://avatars.discourse-cdn.com/v4/letter/h/5fc32e/32.png) [@Hyan](https://meta.discourse.org/u/Hyan)
#### Post date: [September 20, 2023, 6:46am UTC](https://meta.discourse.org/t/get-posts-request-got-plain-http-error/279552/1 "2023-09-20T06:46:48Z")

</div>

Seems this hasn’t been reported when visiting page /posts, browsers shows. example [Discourse Meta](https://meta.discourse.org/posts)

 ![image](https://global.discourse-cdn.com/meta/original/4X/0/4/d/04d1282ce66835b3b18cd074bcc6e4b6b7b46661.jpeg)  
While it should always give an application error page like what you visit [https://meta.discourse.org/posts1](https://meta.discourse.org/posts1)  
 ![image](https://global.discourse-cdn.com/meta/original/4X/a/3/5/a351331da5d77e6eda4b7f7639a4baff4f13b216.jpeg)

---

<div class="post-metadata">

### Author: ![packman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/packman/32/289322_2.png) [@packman](https://meta.discourse.org/u/packman)
#### Post date: [September 20, 2023, 8:53am UTC](https://meta.discourse.org/t/get-posts-request-got-plain-http-error/279552/2 "2023-09-20T08:53:09Z")

</div>

I do get an error page when I follow your first link. Is it a particular browser that does this?

---

<div class="post-metadata">

### Author: ![Hyan](https://avatars.discourse-cdn.com/v4/letter/h/5fc32e/32.png) [@Hyan](https://meta.discourse.org/u/Hyan)
#### Post date: [September 20, 2023, 9:08am UTC](https://meta.discourse.org/t/get-posts-request-got-plain-http-error/279552/3 "2023-09-20T09:08:08Z")

</div>

Tested the link in Chrome, Firefox and Safari private mode.

---

<div class="post-metadata">

### Author: ![Moin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/moin/32/554653_2.png) [@Moin](https://meta.discourse.org/u/Moin)
#### Post date: [September 20, 2023, 10:03am UTC](https://meta.discourse.org/t/get-posts-request-got-plain-http-error/279552/4 "2023-09-20T10:03:53Z")

</div>

When I click the link, I also get the “oops!” page. But when I refresh that page or type the url into a new tab, then it does not work.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [September 20, 2023, 10:12am UTC](https://meta.discourse.org/t/get-posts-request-got-plain-http-error/279552/5 "2023-09-20T10:12:47Z")

</div>

It looks like it’s returning 406 error. The ember app treats it like a 404, but if you reload the browser reports it differently.

It’s an error in either case, and there are no links to that url in the ux, so it’s not clear why it’s a problem.

---

<div class="post-metadata">

### Author: ![Hyan](https://avatars.discourse-cdn.com/v4/letter/h/5fc32e/32.png) [@Hyan](https://meta.discourse.org/u/Hyan)
#### Post date: [September 20, 2023, 1:37pm UTC](https://meta.discourse.org/t/get-posts-request-got-plain-http-error/279552/6 "2023-09-20T13:37:47Z")

</div>

Revise my question - why it returns 406 and an empty page if [Discourse Meta](https://meta.discourse.org/posts) is taken as a non exist page. 404 and an Oops message are more reasonable.

I see 406 response code from network tab in Chrome developer tools. I see a Oops page very occasionally. ~~Displaying the Oops page is reasonable.~~  
My question is no matter what errors are, it’s application’s responsibility to present a user friendly error message (like the Oops page does) rather than a blank page. I guess in case of 406 response, the application doesn’t even be reached. It’s an error reported by a service in front of application, that may be a web server or a proxy server.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [September 20, 2023, 1:45pm UTC](https://meta.discourse.org/t/get-posts-request-got-plain-http-error/279552/7 "2023-09-20T13:45:31Z")

</div>

> [@Hyan](#):
>
> it’s application’s responsibility to present a user friendly error message

Did the application generate the link that you are having trouble with?

Glancing at [discourse/config/routes.rb at main · discourse/discourse · GitHub](https://github.com/discourse/discourse/blob/main/config/routes.rb#1409-L1413) it doesn’t look like it’s a valid route.

~~If you start on a route that is invalid, rails isn’t going to send you the entire ember application to tell you that you have a bad URL.~~

Looks like I’m wrong, [https://meta.discourse.org/bananas](https://meta.discourse.org/bananas) loads the oops page. I guess it’s because `/posts/:id/xxx` is a valid route.

---

<div class="post-metadata">

### Author: ![Hyan](https://avatars.discourse-cdn.com/v4/letter/h/5fc32e/32.png) [@Hyan](https://meta.discourse.org/u/Hyan)
#### Post date: [September 20, 2023, 1:57pm UTC](https://meta.discourse.org/t/get-posts-request-got-plain-http-error/279552/8 "2023-09-20T13:57:50Z")

</div>

> [@pfaffman](#):
>
> I guess it’s because `/posts/:id/xxx` is a valid route.

Yes. That how I end up with this bare /posts URL after removing the rest of parameters (but I forget where I see the /posts/:id/xxx page now). I have thought /posts is a valid route for a user’s all posts. This may be an edge case that Discourse doesn’t cover.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [September 20, 2023, 2:10pm UTC](https://meta.discourse.org/t/get-posts-request-got-plain-http-error/279552/9 "2023-09-20T14:10:30Z")

</div>

I would expect `/posts` to return all posts, but returning all posts on the system is pretty useless. You can find your posts at `https://meta.discourse.org/my/activity`

---

<div class="post-metadata">

### Author: ![Hyan](https://avatars.discourse-cdn.com/v4/letter/h/5fc32e/32.png) [@Hyan](https://meta.discourse.org/u/Hyan)
#### Post date: [September 21, 2023, 2:01am UTC](https://meta.discourse.org/t/get-posts-request-got-plain-http-error/279552/10 "2023-09-21T02:01:31Z")

</div>

> [@pfaffman](#):
>
> but returning all posts on the system is pretty useless.

Agree with this in some degree. /posts returning empty page is this a bug of Discourse? I’m just curious if this should be, but I don’t insist on if this issue has to be fixed. Maybe it’s worthy of a further discussion from Discourse team. 🙂

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [September 21, 2023, 4:26am UTC](https://meta.discourse.org/t/get-posts-request-got-plain-http-error/279552/11 "2023-09-21T04:26:11Z")

</div>

Marking this as #pr-welcome, while valid it’s super low priority.
