Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[eas-cli] Detect valid JSON files during hosting upload #2829

Merged
merged 3 commits into from
Jan 21, 2025

Conversation

kadikraman
Copy link
Contributor

Why

The apple app site association file (needed for Universal linking on iOS) does not have a file extension, as it's simply served from /.well-known/apple-app-site-association.

However in order for it to be valid, the file need to return Content-Type: application/json header.

How

When content type cannot be detected form the mime type, try parsing the file to check if it's a valid JSON and set the header accordingly.

Test Plan

Deploy a website with an apple-app-site-association file and verify that the Content-Type header is set to application/json.

@kadikraman kadikraman requested a review from kitten January 20, 2025 15:35
Copy link

Subscribed to pull request

File Patterns Mentions
**/* @szdziedzic, @khamilowicz, @sjchmiela, @radoslawkrzemien

Generated by CodeMention

Copy link

github-actions bot commented Jan 20, 2025

Size Change: +2.78 kB (+0.01%)

Total Size: 53.4 MB

Filename Size Change
./packages/eas-cli/dist/eas-linux-x64.tar.gz 53.4 MB +2.78 kB (+0.01%)

compressed-size-action

packages/eas-cli/src/worker/upload.ts Outdated Show resolved Hide resolved
Copy link

codecov bot commented Jan 20, 2025

Codecov Report

Attention: Patch coverage is 16.66667% with 10 lines in your changes missing coverage. Please review.

Project coverage is 52.46%. Comparing base (d2e4cb5) to head (dd38e92).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
packages/eas-cli/src/worker/upload.ts 16.67% 10 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2829      +/-   ##
==========================================
- Coverage   52.47%   52.46%   -0.01%     
==========================================
  Files         584      584              
  Lines       22627    22637      +10     
  Branches     4465     4467       +2     
==========================================
+ Hits        11872    11874       +2     
- Misses      10721    10729       +8     
  Partials       34       34              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

✅ Thank you for adding the changelog entry!

@kadikraman kadikraman merged commit 5a16f3d into main Jan 21, 2025
10 checks passed
@kadikraman kadikraman deleted the @kadikraman/json-content-type branch January 21, 2025 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants