# Request header field Content-Type is not allowed by Access-Control-Allow-Headers

**URL:** https://meta.discourse.org/t/request-header-field-content-type-is-not-allowed-by-access-control-allow-headers/95746
**Category:** Bug
**Created:** [August 27, 2018, 2:43pm UTC](https://meta.discourse.org/t/request-header-field-content-type-is-not-allowed-by-access-control-allow-headers/95746 "2018-08-27T14:43:59Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![davide.porrovecchio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/davide.porrovecchio/32/119681_2.png) [@davide.porrovecchio](https://meta.discourse.org/u/davide.porrovecchio)
#### Post date: [August 27, 2018, 2:43pm UTC](https://meta.discourse.org/t/request-header-field-content-type-is-not-allowed-by-access-control-allow-headers/95746/1 "2018-08-27T14:43:59Z")

</div>

I get this error message when trying to add a new post using the [User API key feature](https://meta.discourse.org/t/user-api-keys-specification/48536).  
As [discussed previously](https://meta.discourse.org/t/request-header-field-user-api-key-is-not-allowed-by-access-control-allow-headers/92662) for different values, I think `Content-Type` should be also added to `Access-Control-Allow-Headers` header as defined in [discourse/config/initializers/008-rack-cors.rb at main · discourse/discourse · GitHub](https://github.com/discourse/discourse/blob/master/config/initializers/008-rack-cors.rb#L42)

Here is a [PR](https://github.com/discourse/discourse/pull/6322) that fixes this little bug.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [August 28, 2018, 1:19am UTC](https://meta.discourse.org/t/request-header-field-content-type-is-not-allowed-by-access-control-allow-headers/95746/2 "2018-08-28T01:19:18Z")

</div>

Seems good to me, thanks!

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [August 29, 2018, 8:00am UTC](https://meta.discourse.org/t/request-header-field-content-type-is-not-allowed-by-access-control-allow-headers/95746/3 "2018-08-29T08:00:06Z")

</div>

This topic was automatically closed after 30 hours. New replies are no longer allowed.
