-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
A-webproject: actix-webproject: actix-webC-improvementCategory: an improvement to existing functionalityCategory: an improvement to existing functionality
Description
Expected Behavior
I need the full URL in a response handler.
Request.uri() should print the full URL (e.g. https://example.com/hello-world).
Current Behavior
Prints the path (/hello-world), which is not a valid URI.
Possible Solution
Suggestion:
- The
URIstruct should always be a valid URI, which means it must have a schema + host + origin. - The current behavior of
req.uri()returns thepathof the URI. I think a.path()method is a better name for this. Add afull_uri()method that returns the full URI.
Steps to Reproduce (for bugs)
pub async fn handle_get_resource(
req: actix_web::HttpRequest,
) -> AtomicServerResult<HttpResponse> {
println!("URL: {}", req.uri());Your Environment
- Rust Version (I.e, output of
rustc -V): rustc 1.63.0 (4b91a6ea7 2022-08-08) - Actix Web Version: 4.1.0
Metadata
Metadata
Assignees
Labels
A-webproject: actix-webproject: actix-webC-improvementCategory: an improvement to existing functionalityCategory: an improvement to existing functionality