-
Notifications
You must be signed in to change notification settings - Fork 634
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
Drop axios dependency #3177
Drop axios dependency #3177
Conversation
011d5c7
to
86dd9e3
Compare
packages/bsky/src/config.ts
Outdated
get proxyHeadersTimeout(): number { | ||
return this.cfg.proxyHeadersTimeout ?? 10e3 | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a headsup that this change in timeout was disruptive at least for the PDS use case. Maybe we should set both defaults to something less conservative, like 30s.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As it stands, this will only impact getBlob
calls from the "blob-resolver". The current timeout there is actually 5 seconds (see bellow).
Should I:
- Lower the timeout to match current behavior ?
- Increase to timeout to future proof (when these config become used for other PDS proxying purposes) ?
- Leave it like that?
packages/bsky/src/config.ts
Outdated
const disableSsrfProtection = | ||
process.env.NODE_ENV === 'development' || process.env.NODE_ENV === 'test' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we just configure this option in those environments rather than infer it? Or base it on the value of debugMode
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed the definition of debugMode
so that is is "opt-in" instead of defaulting to true. Added the ability to override the value by setting the BSKY_DISABLE_SSRF_PROTECTION
env var.
packages/bsky/src/image/server.ts
Outdated
const url = await getBlobUrl(dataplane, did, cid) | ||
|
||
const dispatcherOptions: Dispatcher.RequestOptions = { | ||
method: 'GET', | ||
origin: url.origin, | ||
path: url.pathname + url.search, | ||
headers: Object.fromEntries([ | ||
...getBlobHeaders(cfg, url), | ||
['accept-encoding', acceptEncoding], | ||
]), | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The implementation gets a little complicated in order to get everything streaming end-to-end. In case it simplifies the implementation here, this code isn't performance critical and not used in production. The primary use is to run a self-contained local dev environment which is suitable for UI work, without needing to run an additional service such as imgproxy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My primary goal was to re-use as much from blob-resolver as possible. The fact that the entire transformation logic is exposed from here kinda makes sense IMO. I understand that perf improvement here is not a goal.
No description provided.