We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Request
1 parent bccb882 commit f3188f5Copy full SHA for f3188f5
src/Request.ts
@@ -41,6 +41,11 @@ export class Request<A> {
41
*/
42
public readonly server: Server<A>;
43
44
+ /**
45
+ * The components of the request URL path name.
46
+ */
47
+ public readonly pathComponents: ReadonlyArray<string>;
48
+
49
/**
50
* The parsed request cookies from the {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Cookie|Cookie} request header.
51
@@ -70,6 +75,11 @@ export class Request<A> {
70
75
this.ip = ip;
71
76
this.server = server;
72
77
78
+ this.pathComponents = this.url.pathname
79
+ .split("/")
80
+ .map(decodeURIComponent)
81
+ .filter(component => component.length > 0);
82
73
83
this.cookies = new Map(
74
84
this.headers.get("cookie")
85
?.split("; ")
0 commit comments