Skip to content

Add User-Agent header to CURL requests #55

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
May 21, 2019

Conversation

andyexeter
Copy link
Contributor

When making many requests over a short period we have noticed Shopify's API sometimes returns a 403 Forbidden error response for requests that usually work.

I have researched this and believe the requests are being caught by some kind of automated request filtering system on Shopify's servers.

Adding a User-Agent header to all CURL requests resolves this issue. I guess their automated system sees the User-Agent header and assumes it is a valid request instead of some sort of scraper.

Relevant discussion: https://ecommerce.shopify.com/c/shopify-apis-and-technology/t/suddenly-getting-forbidden-request-error-from-shopify-with-curl-411472

@andyexeter
Copy link
Contributor Author

I'm not sure why the build is failing. Seems to be something unrelated to the changeset in this PR.

@tareqtms
Copy link
Contributor

@andyexeter Yes, it's not related to your changes. I will check it and fix before the next release.

@ShayneP
Copy link

ShayneP commented May 2, 2019

I know it's been a while since we've had any activity here, but Shopify would love to see this merged. When we're deciding where to put our hours in the open source library community, it helps to know which libraries are already being used!

@tareqtms tareqtms merged commit 07361d1 into phpclassic:master May 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants