slachiewicz opened a new pull request, #3821:
URL: https://github.com/apache/thrift/pull/3821
Replace deprecated Node.js APIs in the Node.js library:
- **`url.parse()` (`DEP0169`)**: Replace with WHATWG `URL` API in
`web_server.js` (`processPost` and `processGet`), safely handling invalid URL
syntax with a 400 Bad Request response.
- **`fs.exists()` (`DEP0006`)**: Replace with `fs.stat()` in
`web_server.js`, eliminating the deprecated callback and removing a redundant
synchronous `fs.statSync()` call.
- **`require("constants")` (`DEP0063`)**: Replace with
`require("crypto").constants` in `server.js` and `connection.js`.
- **Defensive fix in `createWebServer`**: Default `options.services` to an
empty object `{}` so servers serving static files without services do not throw
a TypeError on incoming POST requests.
- **Testing**: Added test cases in `web_server_ws.test.js` verifying static
file serving, 404 handling, and unregistered service routing.
- [ ] Did you create an [Apache
Jira](https://issues.apache.org/jira/projects/THRIFT/issues/) ticket?
(Minor/trivial maintenance fix)
- [X] Did you squash your changes to a single commit?
- [X] Did you do your best to avoid breaking changes?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]