apple-app-site-association static file is triggering dynamic routing
See original GitHub issueBug report
Describe the bug
In our /public folder we have a file called apple-app-site-association
that is used for deep linking with iOS, etc.
We also have a dynamic route setup that looks like this /[slug]/[id]
When on an iOS device safari looks for this static file apple-app-site-association
but for some reason it’s still triggering Next.js routing. This is then causing the slug to be apple-app-site-association
and trying to then make an API call with that filename value as the string.
We’ve recently upgraded to the latest version of Next.js and it has only recently happened since upgrading.
To Reproduce
Place an apple-app-site-association
file at /public, create a dynamic route like /[slug]/[id] watch for apple-app-site-association
to show up in getInitialProps context.
Expected behavior
This file should be ignored within the routing scope like it was previously.
Issue Analytics
- State:
- Created 3 years ago
- Comments:17 (6 by maintainers)
Top GitHub Comments
I had this issue too. I was able to solve this on Vercel with 2 steps:
./well-known
instead of at the root.vercel.json
file that specifies the headerContent-Type: application/json
.With these 2 things together I was able to resolve the 308 Permanent redirect issue and avoid having the file download to my machine.
Apple will be fine with the file downloading to your machine though, it’s just not ideal when you’re testing it.
Is there some pre-req for this solution. It doesn’t seem to be working for me. Still getting content-type as application/octet-stream.