Skip to content

Conversation

tellyworth
Copy link
Contributor

This uses wp_remote_get() and the CURLOPT_CONNECT_TO curl option to ensure yarn build:patterns will always connect to production servers, even if wordpress.org is sandboxed on your local machine.

Without this, Docker will fail to connect when you're sandboxed, because it respects /etc/hosts but doesn't use the proxy, so the request is denied.

See #118 (comment)

How to test the changes in this Pull Request:

  1. Sandbox wordpress.org in /etc/hosts.
  2. yarn build:patterns should work fine with this PR applied.
  3. Try without the PR, you'll get something like a cURL error 28: Failed to connect timeout.

This uses `wp_remote_get()` and the `CURLOPT_CONNECT_TO` curl option to ensure `yarn build:patterns` will always connect to production servers, even if `wordpress.org` is sandboxed on your local machine.

Without this, Docker will fail to connect when you're sandboxed, because it respects /etc/hosts but doesn't use the proxy, so the request is denied.
@tellyworth tellyworth added the [Type] Bug Something isn't working label Oct 13, 2022
@tellyworth tellyworth requested a review from ryelle October 13, 2022 06:30
Copy link
Contributor

@ryelle ryelle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏻

@ryelle ryelle merged commit 7df1dde into trunk Oct 14, 2022
@ryelle ryelle deleted the fix/build-patterns-sandbox-bypass branch October 14, 2022 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Bug Something isn't working
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants