Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Entire URL cannot be extracted in handler, only path is provided #922

Open
skrcka opened this issue Dec 8, 2024 · 1 comment
Open

Entire URL cannot be extracted in handler, only path is provided #922

skrcka opened this issue Dec 8, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@skrcka
Copy link

skrcka commented Dec 8, 2024

Expected Behavior

uri: &Uri - Entire request url is provided

Actual Behavior

Only path is provided

Steps to Reproduce the Problem

My handler:

#[handler]
pub async fn test_get_url(uri: &Uri) -> Response {
    println!("Request uri: {}", uri);
    Response::builder()
        .status(StatusCode::OK)
        .header("Content-Type", "text/plain")
        .body("OK".to_string())
}

Request:

curl --request GET \
  --url http://127.0.0.1:8000/xd/

print result:

Request uri: /xd/

Specifications

  • Version: poem version = "3.1.1"
  • Platform: MacOS
@skrcka skrcka added the bug Something isn't working label Dec 8, 2024
@attila-lin
Copy link
Collaborator

Maybe we don't have the information of the base url?

How about set to the server then the poem will auto combine them?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants