Change content-type on page response

Change content-type on page response

Tiber
Shopify Partner
31 4 6

I have a React project that I am trying to use as a Shopify Proxy Page. I am trying to change the content-type Response header from "text/html" to "application/liquid" - as per  https://shopify.dev/apps/online-store/app-proxies#liquid-response .

 

I have tried adding it in setupProxy.js

 

module.exports = function(app) {
const appProxy = createProxyMiddleware(context, {
target: target,
secure: false
});
app.use((req, res, next) => {
    res.header("content-type", "application/liquid");
    next();
});
app.use(appProxy);
};

 

but that only affects call to the backend and not pages.

Replies 0 (0)