-
Notifications
You must be signed in to change notification settings - Fork 343
Open
Description
Is there an existing issue for this?
- I have searched the existing issues
What version of workers-rs
are you using?
0.6.0
What version of wrangler
are you using?
^4.23.0
Describe the bug
request: curl http://127.0.0.1:8787/sing-box?remote=https://xxcc/api/v1/client/subscribe?token=xxx
Expected: Deny access!
Actual: INTERNAL SERVER ERROR
Parsed normally when using js, but abnormal when using rust
lib.rs:
use std::collections::HashMap;
use worker::*;
#[event(fetch)]
async fn main(req: Request, env: Env, ctx: Context) -> Result<Response> {
let q: HashMap<String, Vec<String>> = req.query()?;
return Ok(Response::builder().with_status(403).ok("Deny access!")?);
}
log:
invalid type: string "https://xxcc/api/v1/client/subscribe?token=xxx", expected a sequence
Steps To Reproduce
- create project:
cargo generate cloudflare/workers-rs
- edit lib.rs to
use std::collections::HashMap;
use worker::*;
#[event(fetch)]
async fn main(req: Request, env: Env, ctx: Context) -> Result<Response> {
let q: HashMap<String, Vec<String>> = req.query()?;
return Ok(Response::builder().with_status(403).ok("Deny access!")?);
}
- exec:
curl http://127.0.0.1:8787/sing-box?remote=https://xxcc/api/v1/client/subscribe?token=xxx
Metadata
Metadata
Assignees
Labels
No labels