-
Notifications
You must be signed in to change notification settings - Fork 30.9k
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
Support Content-Length and Last-Modified for webview local resources #125994
Conversation
@@ -100,7 +100,9 @@ class RequestStore { | |||
|
|||
/** | |||
* Map of requested paths to responses. | |||
* @typedef {{ type: 'response', body: any, mime: string, etag: string | undefined, } | { type: 'not-modified', mime: string } | undefined} ResourceResponse | |||
* @typedef {{ type: 'response', body: Uint8Array, mime: string, etag: string | undefined, mtime: number | undefined } | |
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.
Note the stronger type on body: Uint8Array
. AFAICT that's the only type which is ever passed through in a response and rely on it being so to call Uint8Array.byteLength
.
@@ -233,15 +235,19 @@ async function processResourceRequest(event, requestUrl) { | |||
} | |||
} | |||
|
|||
/** @type {Record<String, string>} */ | |||
/** @type {Record<string, string>} */ |
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.
typo?
@@ -50,7 +52,7 @@ export async function loadLocalResource( | |||
logService: ILogService, | |||
token: CancellationToken, | |||
): Promise<WebviewResourceResponse.StreamResponse> { | |||
logService.debug(`loadLocalResource - being. requestUri=${requestUri}`); | |||
logService.debug(`loadLocalResource - begin. requestUri=${requestUri}`); |
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.
typo?
Thanks! Will be in the next VS Code insiders build and is scheduled for 1.58 |
Thanks! Is the macOS test failure not a concern? |
Closes #125992
To test (steps from @mjbvz):
img.png
GET
request