Get local URL of Application Proxy, even if shop owner changes it

Highlighted
Shopify Partner
28 0 9

Honestly, I wouldn't expect to get any response about this. I have problems going back over 3 years which I've contacted Shopify about multiple times—through the forums, through support, and through twitter—and still they're not addressed. It might be more productive to write your question on a piece of paper and burn it.

If we do get an answer to this, I will happily eat my words :)

0 Likes
Shopify Partner
12 0 1

Ideally, we'd get a notification for a change in proxy url by the shop owner. 

For now, I'd set a preference in your app defaulting to the proxy url you set, then let the shop owner change the that pref if they change their proxy url.

Would it be possible to get the proxy url from a request header in your proxy endpoint? (e.g., referer)

1 Like
Shopify Partner
12 0 1

There's no reason there can't be a webhook post with the new proxy url information when it's updated. Hell, even a way to query the Shopify API to ask what the current proxy URL is before I write out anything for the customer would be sufficient (even if it is brutish).

Dan

0 Likes
Shopify Partner
10 0 1

Edit: Nevermind. After the shop owner changes the proxy url, the old proxy url returns a 404 Not Found. How would your app receive a request with the new proxy url?? Silly me.

<del>Get the new proxy from the request params.</del>

Here's a sample log entry from a shopify app's web server receiving a proxy request:

method=GET path="/shopifyproxy/?shop=my-new-example-shop.myshopify.com&path_prefix=%2Fapps%2Fvanityproxyurl&timestamp=1430794527&signature=ff7d7e8af8635584f08d097abdd300062f3f6d8507adabc37c9ab5f20fdc3854"

shop: shop's myshopify_domain

path_prefix: the proxy url.

Keep the proxy url somewhere in your db — ideally a column in a model you already query upon proxy request. If path_prefix is different than the proxy url in your db, update it.

That's the best app developers can do for now.

0 Likes
Shopify Partner
17 0 1

Another vote to fix this problem. I think I may just put a warning on my app that says the app will break if they change the proxy URL.

I understand the rationale of allowing the store owner to set their own URL, but for some apps this doesn't make sense. The app developer should be able to toggle on/off whether the store owner can change it or not.

0 Likes
Shopify Expert
3991 13 316

@Lucas, this is not a server side problem. It is all about the client. If the merchant changes the prefix, the client-side JS is useless. 

So either Shopify informs an App of this change, so the App can then adjust the JS (clunky), or Shopify does away with a feature I bet NO ONE uses. Who really cares what the prefix is. My guess is that its a "You think they might need this, but they really don't" legacy. 

Custom Shopify Apps built just for you! hunkybill@gmail.com http://www.resistorsoftware.com
0 Likes