You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import { serve } from "http://evbogue.com:8989/blobs/get/&CNnGcLf0eX1KPtq1t4GjU7jR24Q1bwuD5FRXT2x8U7U=.sha256";
const s = serve("0.0.0.0:8000");
async function main() {
for await (const req of s) {
req.respond({ body: new TextEncoder().encode("Hello World\n") });
}
}
main();
fails with the error:
Downloading http://evbogue.com:8989/blobs/get/&CNnGcLf0eX1KPtq1t4GjU7jR24Q1bwuD5FRXT2x8U7U=.sha256...thread 'tokio-runtime-worker-2' panicked at 'called `Option::unwrap()` on a `None` value', libcore/option.rs:355:21
note: Run with `RUST_BACKTRACE=1` for a backtrace.
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Canceled', libcore/result.rs:1009:5
which I think is because the filename is .sha256 instead of .ts.
No, that feels very unsafe... We support extensions, followed by Content-Type. We support a wide array of common TypeScript media types, but supporting a lack of it, the file should be treated as suspicious, IMO. We support JavaScript, TypeScript and JSON at the moment, I am not sure "guessing" is a good idea.
Example:
fails with the error:
which I think is because the filename is
.sha256
instead of.ts
.reported here
The text was updated successfully, but these errors were encountered: