Fix double slashing
This commit is contained in:
parent
67aacf8391
commit
83d2644bf4
2 changed files with 3 additions and 3 deletions
|
@ -31,8 +31,8 @@ export const registerStreamProtocol = () => {
|
|||
const url = request.url;
|
||||
const { host, pathname } = new URL(url);
|
||||
switch (host) {
|
||||
/* stream://write//path/to/file */
|
||||
/* -host/pathname----- */
|
||||
/* stream://write/path/to/file */
|
||||
/* host-pathname----- */
|
||||
case "write":
|
||||
try {
|
||||
await writeStream(pathname, request.body);
|
||||
|
|
|
@ -25,7 +25,7 @@ export const writeStream = async (path: string, stream: ReadableStream) => {
|
|||
// In another twist, the TypeScript libdom.d.ts does not include the
|
||||
// "duplex" parameter, so we need to cast to get TypeScript to let this code
|
||||
// through. e.g. see https://github.com/node-fetch/node-fetch/issues/1769
|
||||
const req = new Request(`stream://write/${path}`, {
|
||||
const req = new Request(`stream://write${path}`, {
|
||||
// GET can't have a body
|
||||
method: "POST",
|
||||
body: stream,
|
||||
|
|
Loading…
Add table
Reference in a new issue