Fork me on GitHub
#ring
<
2018-06-20
>
petr.mensik15:06:57

@seancorfield Result is actually the same - however I've noticed that the file itself has 17 KB but the one returned by Ring has 28 KB (and at the same time LibreOffice is complaining about downloaded file being corrupted)

seancorfield15:06:06

Hmm, we serve images via Ring's file-response with content-type applied to it. Are you sure none of your middleware is messing with the response? Have you tried examining the response headers either in the browser devtools or via curl -I @petr.mensik?

petr.mensik15:06:22

These headers are being returned

{
  "cache-control": "no-cache, must-revalidate, proxy-revalidate",
  "content-disposition": "attachment; filename=supply.xlsx",
  "content-length": "16584",
  "content-type": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
  "date": "Wed, 20 Jun 2018 15:46:59 GMT",
  "last-modified": "Wed, 20 Jun 2018 15:46:59 GMT",
  "server": "http-kit",
  "x-content-type-options": "nosniff",
  "x-frame-options": "DENY",
  "x-xss-protection": "1; mode=block"
}

petr.mensik15:06:47

I'll try to disable some middleware and see if ti changes anything

seancorfield15:06:28

Those headers look reasonable -- and the Content-Length looks close to your expected 17K.

petr.mensik15:06:40

hmm, weird, it's probably Swagger issue because I can download the file with curl

petr.mensik15:06:47

so I guess it's fine - thanks you 🙂

seancorfield15:06:22

Cool. File downloads (and uploads) always seem to be the most problematic aspects of dealing with Ring 🙂