Skip to content

Fix saving and re-opening of server-side documents on VS Code 1.101.0 #1584

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

Merged
merged 1 commit into from
Jun 13, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions src/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,25 @@ export class AtelierAPI {

return data;
} catch (error) {
if (
error?.message?.includes("Connection: close") &&
path?.includes("/doc/") &&
headers &&
headers["IF-NONE-MATCH"]
) {
// This "Parse Error: Data after `Connection: close`" error is caused by
// stricter behavior in the llhttp library introduced in Node 22/VS Code 1.101.0.
// This only affects servers that use IIS as a web server, and it only occurs
// when a 304 Not Modified response is sent from the server.
// See https://github.com/intersystems-community/vscode-objectscript/issues/1583
if (outputTraffic) {
outputRequest();
outputChannel.appendLine(`+- RESPONSE -----------------------------------------`);
outputChannel.appendLine("304 Not Modified");
outputChannel.appendLine(`+- END ----------------------------------------------`);
}
throw { statusCode: 304, message: "Not Modified" };
}
if (outputTraffic && !error.statusCode) {
// Only output errors here if they were "hard" errors, not HTTP response errors
outputRequest();
Expand Down