Skip to content
Open
Show file tree
Hide file tree
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
8 changes: 7 additions & 1 deletion lib/_http_outgoing.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,14 +287,20 @@ OutgoingMessage.prototype.uncork = function uncork() {
callbacks.push(buf[n + 2]);
}
}
this._send(crlf_buf, null, callbacks.length ? (err) => {
const ret = this._send(crlf_buf, null, callbacks.length ? (err) => {
for (const callback of callbacks) {
callback(err);
}
} : null);

this[kChunkedBuffer].length = 0;
this[kChunkedLength] = 0;

// If we successfully flushed and had pending drain, emit it
if (ret && this[kNeedDrain]) {
this[kNeedDrain] = false;
this.emit('drain');
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ThierryMT it looks like these are the changes from #60437, which I think aren't directly related to this change.

Can you remove these HTTP changes so we can handle them separately in that other PR?

};

OutgoingMessage.prototype.setTimeout = function setTimeout(msecs, callback) {
Expand Down
6 changes: 6 additions & 0 deletions lib/internal/modules/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@ const realpathCache = new SafeMap();
* @returns {string}
*/
function toRealPath(requestPath) {
// On Windows, ensure the path is valid before calling realpathSync
// to avoid EISDIR errors with malformed paths like 'C:' (drive letter only)
if (process.platform === 'win32' && requestPath.length === 2 && requestPath[1] === ':') {
// If we have just a drive letter, add trailing backslash to make it valid
requestPath += '\\';
}
return fs.realpathSync(requestPath, {
[internalFS.realpathCacheKey]: realpathCache,
});
Expand Down