Keeping Content-Length headers

Hi all,

I’ve got a specific URL for a Rails app hosted on Render that needs to return the Content-Length header - and it does in my local environment, and when I use curl via the internal shell in the dashboard. But publicly, the header isn’t there - it seems Render’s Cloudflare setup (or Cloudflare more generally) removes it as part of their proxying, even though the response is sending through headers to avoid caching the response.

This specific URL is required for Microsoft Azure’s domain verification - it’s their tool that insists on the content length being present. So unless anyone has a contact at Microsoft, I’d really like to find a way through this.

I have tried adding no-transform to the Cache-Control header - so now it returns max-age=0, private, must-revalidate, no-transform, as well as manually returning a gzipped response (in the hope Cloudflare wouldn’t muck around with it). No luck with either approach.

Any suggestions? :sweat_smile:

Were you able to solve this?

I am having the exact same issue for the same reason (trying to verify the domain on Microsoft Azure).

From what I can recall, the Render team stepped in, disabled Cloudflare manually for my app, let me verify it, then re-enabled Cloudflare.

But also, I found out later on that I was using a personal Azure account, and had to change things later to use an organisation Azure account instead - and organisation accounts let you verify a domain at the org level (not just at the app level) and that verification can be done via a TXT DNS record. So, if you can do it that way, I’d recommend it, because I suspect the Render team don’t want to be mucking around with manual interventions if at all possible. :sweat_smile:

2 Likes

Thanks for coming back and answering! I am indeed trying both fronts, Render’s support and TXT DNS. DNS record seems the easy route, I don’t know why Microsoft doesn’t make obvious in the Azure dashboard that this is an option too.

1 Like