feat: serve any componentpack file #4894
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Allows any file within a component pack to be served.
Previously, serving files from within a componentpack was limited to the regex
[a-zA-Z0-9\\-_]+\\.(?:json|js|xml|txt|css){1}(?:\\.map)?}"
so in short, only files with a single.
and were of the listed extensions could be served. This limitations seems to be somewhat historical but presents issues when componentpacks need to contain other files that need to be served.There does not seem to be any reason for limiting the files served from a component pack (the component pack review process should vet and discover anything that it not appropriate) so in order to support all uses cases, any file inside of a componentpack can be served.
Additionally, the
Content-Disposition
headerfilename
property will contain the actual filename of the file being served instead of the genericpack.js
. TheContent-Disposition
isn't really required since files within the component pack aren't being "downloaded" via the browser but leaving thefilename
property in-place for now, just with the correct name of the file.Testing
Tested locally and all tests pass. e2e & ci will cover rest.