-
Notifications
You must be signed in to change notification settings - Fork 2
feat: Files Plugin #115
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
Open
atilafassina
wants to merge
21
commits into
main
Choose a base branch
from
plugin/files
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
feat: Files Plugin #115
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
6f76009
chore: first draft
atilafassina ce82860
chore: add files route to dev-playground
atilafassina be66fdd
chore: add `injectRoutes` logic to plugin
atilafassina b27e231
feat: add stream and cache
atilafassina ece130a
chore: file upload stream
atilafassina 5d85548
chore: deduplicate tests, cleanup
atilafassina 5b0a682
chore: skip bail `req.body` type for specific routes in Server plugin
atilafassina a1c05c4
chore: remove dev-playground files integration
atilafassina 91367c2
docs: update
atilafassina da0e62f
chore: cleanup integration tests
atilafassina 09f86c3
fix: add file resource to manifest
atilafassina 79bd173
refactor: move client to `/connectors`
atilafassina f4826dc
chore: improve preview and MIME checks
atilafassina 60b1bcd
chore: fix merge conflicts
atilafassina 5200066
docs: update
atilafassina a0dda75
chore: address code-review, improve consistency across endpoints, fix…
atilafassina b95711f
fix: xss vulnerability on raw serving files
atilafassina 1c5805b
chore: linter warnings
atilafassina e5e973d
fix: docs generation
atilafassina bb57226
chore: security in-depth and a few inconsistencies between docs and m…
atilafassina 07b6671
clean up JSDoc
atilafassina File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| # Function: contentTypeFromPath() | ||
|
|
||
| ```ts | ||
| function contentTypeFromPath( | ||
| filePath: string, | ||
| reported?: string, | ||
| customTypes?: Record<string, string>): string; | ||
| ``` | ||
|
|
||
| Resolve the MIME content type for a file path. | ||
|
|
||
| ## Parameters | ||
|
|
||
| | Parameter | Type | Description | | ||
| | ------ | ------ | ------ | | ||
| | `filePath` | `string` | Path to the file (only the extension is inspected). | | ||
| | `reported?` | `string` | Optional MIME type reported by the caller; used as fallback when the extension is unknown. | | ||
| | `customTypes?` | `Record`\<`string`, `string`\> | Optional map of extension → MIME type overrides (e.g. `{ ".csv": "text/csv" }`). | | ||
|
|
||
| ## Returns | ||
|
|
||
| `string` | ||
|
|
||
| The resolved MIME content type string. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.