Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Re: Remove query params from app proxy

Remove query params from app proxy

nikarc321
Visitor
3 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

Replies 3 (3)

Gregarican
Shopify Partner
1033 86 293

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...

nikarc321
Visitor
3 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 @Gregarican!

Gregarican
Shopify Partner
1033 86 293

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 🙂