• Resolved maltfield

    (@maltfield)


    Can you please tell me exactly which file and function and line is responsible for initiating a request to the following URL when my website uses the woocommerce block to display all products?

    /wp-json/wc/store/v1?_locale=user

    I have an issue with a website that is accessible on two domains: a clearnet domain and a darknet domain. Both domains talk to the same backend apache web server. One comes-in over the Tor network/daemon. The other comes-in over nginx.

    * https://tech.michaelaltfield.net/2021/02/12/wordpress-multisite-tor-alias/

    The website loads fine on the clearnet domain https://buskill.in

    Unfortunately, there is an issue where the products never load in the woocommerce block to display all products; it basically just spins indefinitely https://buskillvampfih2iucxhit3qp36i2zzql3u6pmkeafvlxs3tlmot5yad.onion/

    I checked the web browser’s dev tools, and I saw that there was one request failing when loading the site in the Tor Browser. Here’s a subset of the request headers:

    OPTIONS /wp-json/wc/store/v1?_locale=user undefined
    Host: buskillvampfih2iucxhit3qp36i2zzql3u6pmkeafvlxs3tlmot5yad.onion

    However, when I load the clearnet domain for the same page in firefox, the first request for *wp-json* is a GET request (not OPTIONS). Here’s a subset of the request headers:

    GET /wp-json/wc/store/v1?_locale=user HTTP/1.1
    Host: https://www.buskill.in

    For security reasons, I actually block OPTIONS requests to my webserver, so I suspect this is the issue.

    What I don’t understand is why woocommerce tries to have the client execute an OPTIONS request on my customers visiting my site via our Onion Service, yet it’s a GET request on my customers visiting the site on the clearnet domain.

    Can you please point me to the relevant file, function, and line number that is responsible for telling the client to make this ajax call in the woocommerce sourcecode?

Viewing 1 replies (of 1 total)
  • Saif

    (@babylon1999)

    Hello @maltfield,

    Seems like you have a very interesting setup. This is a fairly complex development topic. I’m going to leave it open for a bit to see if anyone is able to chime in to help you out.

    I will recommend you try working with a WooExpert to figure out a custom solution.

    You can also visit the WooCommerce Facebook group or the #developers channel of the WooCommerce Community Slack. We’re lucky to have a great community of open-source developers for WooCommerce, and many of our developers hang out there, as well.

    Cheers!

Viewing 1 replies (of 1 total)
  • The topic ‘Code responsible for initiating GET or OPTIONS call to ‘/wp-json/wc/store/v1’?’ is closed to new replies.