2

I am trying to serve apple-app-site-association from the S3 via CloudFront distribution via my custom domain.

But when I am given a path like below, It's started downloading rather than showing in the browser.

https:/mycustomdonain.com/.well-known/apple-app-site-association

Do I need to make any setting at S3 or CloudFront level to make it work?

Note: The application is developed in Angular.

Thanks

Clashsoft
  • 11,553
  • 5
  • 40
  • 79
Hardik Vinzava
  • 968
  • 10
  • 22
  • 2
    The browser will determine if it will download a file or display it depending on the value of the Content-Type (sometimes in combination with Content-Disposition) header. If the value is application/json it will most probably be displayed. S3 automatically applies content type for files you are upload Amazon S3 usually based on their extension. I believe if you set the type of the file to `application/json` it will be displayed, see here https://stackoverflow.com/questions/14150854/aws-s3-display-file-inline-instead-of-force-download – Christos Koninis Dec 09 '21 at 12:01

1 Answers1

3

As Christos says, you need to set the content-type response header in S3, which then also applies to Cloudfront HTTPS URLs.

Here is an example of mine, that I use for deep linking and OpenID Connect with an HTTPS redirect URI:

Further details on how this looks in my blog post, where you set the content type by editing tte file properties:

File Properties

Gary Archer
  • 22,534
  • 2
  • 12
  • 24