Skip to content

Commit 73db22c

Browse files
authored
Update index.js
1 parent d3e9b29 commit 73db22c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,11 @@ function honoWrapper(compiler, options) {
521521
/**
522522
* @returns {string | undefined}
523523
*/
524-
req.getURL = () => c.req.url;
524+
req.getURL = () => {
525+
// use c.set,because c.req.url read only!
526+
const reqUrl = c.get('c_req_url');
527+
return reqUrl ? reqUrl : c.req.url;
528+
}
525529

526530
let { status } = c.res;
527531

0 commit comments

Comments
 (0)