next.js
11fa91b8 - Rename url to path for onRequestError request arg (#68672)

Commit
1 year ago
Rename url to path for onRequestError request arg (#68672) ### What * Rename the `request.url` in onRequestError callback arg to `request.path` * Align `routeType: "middleware"` with others, only contain the resource path in the `request.path`, stripped out request origin. ### Why For non middleware case, the `req.url` in next-server is actual resource path, which only contains the pathname and search but without request origin. For middleware case, the origin is included in the `req.url`. This might be a implementation detail, but for users, having request origin here might not be critical and super helpful since they will know the deployment as a global context for error tracking. Hence we align the property to a variable that not holding request origin, given a better naming `request.path`. The idea is from `:path` request header, which represents the resource path, only containing pathname and search. e.g. `/a/b?c=2` x-ref: https://greenbytes.de/tech/webdav/draft-ietf-httpbis-http2-09.html#HttpRequest Closes NDX-54
Author
Parents
Loading