Foxy Forum Status

We're no longer responding to questions via our forum, but we will keep it up for historical reasons. If you can't find the answer you're looking for, please visit our knowledge base or contact us. If there's enough interest in the future, we may bring the forum back.

Status 412 when store_template_cache method

I am working with your API trying to update my template.
I have a stored file on a server, but your response is an error:

Please review the errors below, then correct them and re-cache your template.</p>
<ul><li>The URL you attempted to cache returned a status code of <strong>412</strong>.
Please confirm the URL exists, and the server is returning a successful status code, such as 200.

Here is the params sent to endpoint:
[api_token] => dAtAfEed-T0keN
[api_action] => store_template_cache
[template_type] => checkout
[template_url] =>

When I manually cache with the template url, it is successful in FoxyCarts admin.
Any ideas what a 412 is?
  • brettbrett FoxyCart Team
    @richtestani, that's odd. Googling for the 412 error looks like it's your server denying the request because of header information. I haven't had a chance to take a look at how an API caching request would be different from an admin caching request, but does your server maybe have some security that prevents certain requests from being served?
  • Brett,
    Is it possible to post the text to the API instead of a file path?
    If not, I'll check with my server host and see what they think about this.

    Thanks for the reply.
  • fc_adamfc_adam FoxyCart Team

    Unfortunately not at this time - it just accepts a URL for the page to cache.
  • I asked my web host about the issue and they presented this snippet from their logs. According to them, the request if from IE6 and they block IE6 from making such requests.

    From their response:
    There is a mod_security rule on our servers against a well known hacking bot, which uses one specific IE 6 user agent string: "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)" This is the reason for the error received. - - [27/Jul/2015:11:29:52 -0400] "GET /themes/Coobie/foxycart/templates/checkout.php HTTP/1.0" 412 1098 "" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)" 0 0 "off:-:-" 207 56787 - - [27/Jul/2015:11:32:26 -0400] "GET /themes/Coobie/foxycart/templates/checkout.php HTTP/1.0" 412 1098 "" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)" 0 0 "off:-:-" 207 55598 - - [27/Jul/2015:11:37:56 -0400] "GET /themes/Coobie/foxycart/templates/checkout.php HTTP/1.0" 412 1098 "" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)" 0 0 "off:-:-" 207 56442 - - [27/Jul/2015:11:44:49 -0400] "GET /themes/Coobie/foxycart/templates/checkout.php HTTP/1.0" 412 1098 "" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)" 0 0 "off:-:-" 207 55639

    Does this make sense to you?
  • brettbrett FoxyCart Team
    edited July 2015
    Yeah. Probably time to update our useragent string we're using :) Please give us a bit. (Shouldn't take long but it's gotta go through QA and such.)
  • No worries - glad I could help here. Let me know when you've got that taken care of.
    Thanks for the reply.
  • brettbrett FoxyCart Team
    @richtestani, this one might actually be a little more involved than we thought. We're taking a look, but I don't think it's as obvious on our end exactly what the issue is, so it might take us a bit to figure it out. Thx for your patience.
  • brettbrett FoxyCart Team
    @richtestani, give it a try now. Thanks!
  • Brett, it works now!
    Thank you so much for your help!

  • brettbrett FoxyCart Team
    Glad to hear it, @richtestani :)
Sign In or Register to comment.