Skip to content

Commit 2decaef

Browse files
Allow for trailing slash in URLs
1 parent e4a59e2 commit 2decaef

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

build.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const pathMatches = fileNames.map((name) => `"/${name}"`)
1919
const pathMatcher = `match req.get_path() {
2020
${pathMatches.join(' | ')} => req.with_set_header("Host", "hyperquark.github.io").send(BACKEND)?,
2121
path @ _ => {
22-
let ok_path_re = Regex::new(r"^/(settings|about|projects/(file|test|\d+))?$").unwrap();
22+
let ok_path_re = Regex::new(r"^/((settings|about|projects/(file|test|\d+))/?)?$").unwrap();
2323
if ok_path_re.is_match(path) {
2424
Request::get("https://hyperquark.github.io/").send(BACKEND)?
2525
} else {
@@ -30,4 +30,4 @@ const pathMatcher = `match req.get_path() {
3030

3131
console.log(pathMatcher)
3232

33-
await writeFile('path-matcher.rs', pathMatcher, { encoding: 'utf8' });
33+
await writeFile('path-matcher.rs', pathMatcher, { encoding: 'utf8' });

0 commit comments

Comments
 (0)