Skip to content

Commit 08c8c9a

Browse files
committed
Fix: use super::KV_BINDING
1 parent 0564358 commit 08c8c9a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/shortlink/root.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ use std::str::FromStr;
22

33
use worker::{Request, Response, Result, RouteContext, Url};
44

5+
use super::KV_BINDING;
6+
57
macro_rules! redirect_if_prefix {
68
($path:expr, { $($prefix:literal => $url:expr),* $(,)? }) => {
79
$(
@@ -15,7 +17,7 @@ macro_rules! redirect_if_prefix {
1517
}
1618

1719
pub async fn root(req: Request, ctx: RouteContext<()>) -> Result<Response> {
18-
let kv = ctx.kv("KVNamespace")?;
20+
let kv = ctx.kv(KV_BINDING)?;
1921
let path = &req.url()?.path().to_string()[1..];
2022

2123
redirect_if_prefix!(path, {

0 commit comments

Comments
 (0)