Closed aceslick911 closed 1 year ago
@aceslick911 Thank you so much for your contribution here!
The idea to add Apple CDN Debug Headers is great! I reviewed your code and can see what you are trying to do.
Please note that I have tested and can confirm that the headers are not being added to the output of the CLI or web app. Have you tested on your end? Could you show me a screenshot of what you are seeing?
Here are some instructions on how you can test the web app locally:
cd webapp
Let me know if you have any questions about this.
Also, could you please try refactoring the code to not change these functions:
Please make a new function (something like getAppleCDNDebugHeaders() ) that holds the logic. You should be able to accomplish the same thing you are trying by calling your new function within loadAASAContents().
Hi @chayev
Apologies I must have messed something up after rebasing š
getAppleCDNDebugHeaders
functionHere's an example of ASA failures with the cleaned up code:
Here's an example where all checks pass:
Hope this can help other teams out there - as it's so difficult and complicated these days to figure out what's gone wrong with deep linking without helpful validation tools that cover conditions not even listed in most documentation out there.
So many external factors - which is why I was compelled to make this contribution š
@aceslick911 Thank you again for addressing the changes requested. From taking a quick look I can now see the output in the web app! I will need more time to review the code a bit closer, will keep you updated.
I wanted to share this quote to show how important this change is: "Starting with macOS 11 and iOS 14, apps no longer send requests for apple-app-site-association files directly to your web server. Instead, they send these requests to an Apple-managed content delivery network (CDN) dedicated to associated domains." source
We will get this added into production as soon as the code is review.
@aceslick911 for now, could you please rebase and squash (or fixup) so that there is only one commit? It would make merging this PR cleaner. Let me know if you have any questions/concerns about this.
Thanks for the review @chayev - addressed all the comments ā
All were valid and easy to address :)
Rebased and squashed š
@aceslick911 thanks for addressing the review so quickly! Confirming that I see all of the changed and they look great.
Please note that something is off now. It looks like the Apple CDN Cache Checks always fail. It might be due to the lines 314 - 317. The CDN Cached Contents are always empty. See facebook.com for example:
I checked a few other domains as well. They were working before and now it always comes back as a failure. Please address when you get a chance.
Thanks having a look now @chayev
Woops. != instead of ==
fixed
@aceslick911 thank you so much for your contribution to this project! This PR has been merged into main and will be included in the next release.
If you have any other idea, we are open to them! Please contribute again.
Feel free to reach out to me via email (michael @ chayev.com [no spaces]), I would like to learn how you use yURL and if you have any suggestions on how we can do better.
Added apple CDN debug headers Eg:
adds new output:
Apple CDN Debug Headers: https://app-site-association.cdn-apple.com/a/v1/MYDOMAIN AppleFailureDetails: [{"status":"403 Forbidden"}] AppleFailureReason: [SWCERR00101 Bad HTTP Response: 403 Forbidden] AppleFrom: [https://MYDOMAIN/.well-known/apple-app-site-association] AppleTryDirect: [false] CacheControl: [max-age=1800,public] ContentLength: [10] Date: [Fri, 20 Jan 2023 04:15:46 GMT] Expires: [Fri, 20 Jan 2023 04:15:57 GMT] Via: [https/1.1 ausyd2-vp-vst-003.ts.apple.com (acdn/176.13298), https/1.1 ausyd2-vp-vfe-005.ts.apple.com (acdn/168.13283), http/1.1 ausyd2-edge-lx-011.ts.apple.com (acdn/59.14204), http/1.1 ausyd2-edge-bx-017.ts.apple.com (acdn/59.14204)] Age: [1538]