Skip to content

Refactor download format links helper#8185

Merged
javierjulio merged 1 commit into
masterfrom
download-links-update
Dec 24, 2023
Merged

Refactor download format links helper#8185
javierjulio merged 1 commit into
masterfrom
download-links-update

Conversation

@javierjulio

@javierjulio javierjulio commented Dec 24, 2023

Copy link
Copy Markdown
Member

Refactors the download format links since there's no need for formats and add_format methods. The latter is already set via config which is preferred. The config initializer template has been updated to note that the format must be registered with mime type if it isn't. We will look into removing the respond_to :xml, :json defaults for security reasons since download formats are accessible without links and can expose resource and associated data.

@javierjulio javierjulio self-assigned this Dec 24, 2023
This is undocumented. No need to provide since the formats can be set through the download_links config which is preferred. We'll update our config initializer template to note that the format must be registered with mime type if it isn't.

Eventually, we'll remove the XML and JSON defaults along with the respond_to for security reasons since they are still accessible as public routes even without links. Users should declare this for each resource where they need it.
@javierjulio javierjulio force-pushed the download-links-update branch from 2be82a5 to b1a86f2 Compare December 24, 2023 08:03
@codecov

codecov Bot commented Dec 24, 2023

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (ef86028) 99.04% compared to head (b1a86f2) 99.03%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8185      +/-   ##
==========================================
- Coverage   99.04%   99.03%   -0.01%     
==========================================
  Files         152      151       -1     
  Lines        4173     4151      -22     
==========================================
- Hits         4133     4111      -22     
  Misses         40       40              

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

@javierjulio javierjulio merged commit 5c7d5b7 into master Dec 24, 2023
@javierjulio javierjulio deleted the download-links-update branch December 24, 2023 08:08
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.

1 participant