Skip to content

Bypass the sandbox when running build:patterns #135

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 14, 2022

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