Remove query params from app proxy

Highlighted
New Member
2 0 0

Hello,

I'm using an App Proxy to proxy requests to Contentful, where I have some shared data. Unfortunately, Contentful will throw a 400 error on any request which has query params it doesnt recognize; the app proxy provides path_prefix, timestamp, signature, and shop by default.

Is there anyway to remove these query params from the app proxy?

 

Thanks

0 Likes
Highlighted
Shopify Partner
331 23 68

I'd be surprised if this is a configurable option --> https://shopify.dev/tutorials/display-data-on-an-online-store-with-an-application-proxy-app-extensio.... Although what I would do is define my app proxy as some resource that I control. In a pinch it could be a small AWS or Azure web service. That resource can validate the app proxy calls coming into it. Using the HMAC signature validation. If the call validates then in turn my resource would forward the request to Contentful. Using whatever format and content that Contentful is expecting. Sounds like another hoop to jump through I know, but this would work...

0 Likes
Highlighted
New Member
2 0 0

Yeah, that was one of things I was also considering, using something like AWS. I was just curious if there was any way to do it straight from the app proxy :/

 

Thanks @Greg_Kujawa!

0 Likes
Highlighted
Shopify Partner
331 23 68

My pleasure! In the grand scheme of things you'd want to validate inbound requests, so the HMAC signature serves a purpose. And I'd imagine that the Contentful service would require some type of authentication or authorization anyway. You can handle that part with your AWS middleman. Plus in the future if you have other services you'd like to connect to, then your middleman can also conditionally farm out calls to them using the same app proxy. Just providing different context. It's actually a beautiful thing :)    

0 Likes