mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2026-07-14 15:52:46 +00:00
Fix Node.js deprecated warning (#9742)
* Fix Node.js deprecated warning * Add ChangeNote * Change deprecation to bugfix for DEP0169 warning Updated change type from 'deprecation' to 'bugfix' for the Node.js server's handling of the DEP0169 warning.
This commit is contained in:
@@ -9,15 +9,14 @@ Serve tiddlers over http
|
||||
|
||||
"use strict";
|
||||
|
||||
let fs, url, path, querystring, crypto, zlib;
|
||||
let fs, path, crypto, zlib, URL;
|
||||
|
||||
if($tw.node) {
|
||||
fs = require("fs"),
|
||||
url = require("url"),
|
||||
path = require("path"),
|
||||
querystring = require("querystring"),
|
||||
crypto = require("crypto"),
|
||||
zlib = require("zlib");
|
||||
URL = require("url").URL;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -260,8 +259,8 @@ Server.prototype.requestHandler = function(request,response,options) {
|
||||
state.wiki = options.wiki || self.wiki;
|
||||
state.boot = options.boot || self.boot;
|
||||
state.server = self;
|
||||
state.urlInfo = url.parse(request.url);
|
||||
state.queryParameters = querystring.parse(state.urlInfo.query);
|
||||
state.urlInfo = new URL(request.url, "http://localhost");
|
||||
state.queryParameters = Object.fromEntries(state.urlInfo.searchParams);
|
||||
state.pathPrefix = options.pathPrefix || this.get("path-prefix") || "";
|
||||
// Enable CORS
|
||||
if(this.corsEnable) {
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
change-category: nodejs
|
||||
change-type: bugfix
|
||||
created: 20260711020057000
|
||||
description: The Node.js server no longer emits the DEP0169 url.parse() deprecation warning
|
||||
github-contributors: pmario
|
||||
github-links: https://github.com/TiddlyWiki/TiddlyWiki5/pull/9742
|
||||
release: 5.5.0
|
||||
tags: $:/tags/ChangeNote
|
||||
title: $:/changenotes/5.5.0/#9742
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
* The server module parses request URLs with the WHATWG `URL` API instead of the deprecated `url.parse()`, so recent Node.js versions no longer print the DEP0169 deprecation warning on startup (fixes [[Issue #9628|https://github.com/TiddlyWiki/TiddlyWiki5/issues/9628]])
|
||||
Reference in New Issue
Block a user