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

feat: respect accept header in server #153

Merged
merged 3 commits into from Mar 6, 2024
Merged

Conversation

eduardoboucas
Copy link
Member

Which problem is this pull request solving?

This is a follow-up to #147. The new API endpoints can respond to a "get blob" operation by issuing a signed URL or by returning the blob bytes directly. This behaviour is controlled with the accept header.

This PR ports that behaviour to the local server.

@eduardoboucas eduardoboucas requested a review from a team as a code owner March 6, 2024 14:28
@github-actions github-actions bot added the type: feature code contributing to the implementation of a feature and/or user facing functionality label Mar 6, 2024
Copy link

netlify bot commented Mar 6, 2024

Deploy Preview for blobs-js ready!

Name Link
🔨 Latest commit 3222b70
🔍 Latest deploy log https://app.netlify.com/sites/blobs-js/deploys/65e87df43bacc3000860d70a
😎 Deploy Preview https://deploy-preview-153--blobs-js.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.


if (parts.length === 2 || (parts[0].toLowerCase() === 'bearer' && parts[1] === this.token)) {
if (authorization.toLowerCase().startsWith('bearer ') && authorization.slice('bearer '.length) === this.token) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The previous implementation didn't handle tokens with a space.

@eduardoboucas eduardoboucas merged commit 8259e5e into main Mar 6, 2024
9 checks passed
@eduardoboucas eduardoboucas deleted the feat/server-legacy-api branch March 6, 2024 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature code contributing to the implementation of a feature and/or user facing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants