# Curl error connecting local Discourse and WordPress sites

**URL:** <https://meta.discourse.org/t/curl-error-connecting-local-discourse-and-wordpress-sites/248722>\
**Category:** Development\
**Created:** [December 12, 2022, 11:39pm UTC](https://meta.discourse.org/t/curl-error-connecting-local-discourse-and-wordpress-sites/248722 "2022-12-12T23:39:25Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)\
**Post date:** [December 12, 2022, 11:39pm UTC](https://meta.discourse.org/t/curl-error-connecting-local-discourse-and-wordpress-sites/248722/1 "2022-12-12T23:39:26Z")

</div>

For the past while I’ve been getting the following error when attempting to connect my local Discourse and WordPress sites:

`cURL error 61: Unrecognized content encoding type. libcurl understands deflate, gzip, br content encodings.`

The issue seems to be that in a local dev environment, Discourse is setting the following header:

`content-encoding: null`

My local Apache server is unable to handle the `content-encoding: null` header. From my wp shell, a request to `wp_remote_get("http://localhost:4200/site.json")` fails with the error I posted above, while a request to a Discourse production site, for example `wp_remote_get("https://meta.discourse.org/site.json")` works without any issues.

My temporary workaround for the issue is to comment out this line on my local Discourse install: [https://github.com/discourse/discourse/blob/main/app/assets/javascripts/bootstrap-json/index.js#L330](https://github.com/discourse/discourse/blob/main/app/assets/javascripts/bootstrap-json/index.js#L330). That’s not a great solution though. Has anyone run into similar issues with connecting to a Discourse site running on localhost? Does anyone have suggestions for how to configure a local Apache server to accept responses that have the `content-encoding: null` header?

I wish I knew exactly when the issue started. Possibly it’s been occurring since Discourse started setting the `content-encoding: null` header.

Edit: the issue is happening on Ubuntu 22.04.1. Curl version: `curl 7.81.0`. PHP version: `8.1.2`. This isn’t at all urgent, but I’m curious about what’s going on.

---

_[View the full topic](https://meta.discourse.org/t/curl-error-connecting-local-discourse-and-wordpress-sites/248722)._
