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

implemented function which returns full uri #3096

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

TimoCak
Copy link

@TimoCak TimoCak commented Aug 2, 2023

PR Checklist

  • Tests for the changes have been added / updated.
  • Documentation comments have been added / updated.
  • A changelog entry has been made for the appropriate packages.
  • Format code with the latest stable rustfmt.
  • (Team) Label with affected crates and semver status.

Overview

Hi Guys,

i implemented a new method called full_uri() for the HttpRequest Type. To get the full uri of a request since the already existing method uri() does not have this functionality.
It seemed to me like an easy solution to get informations which will be provided from HttpRequest methods.
So i used the connection_info() method to extract the scheme and the host from the Request.
The origin can be provided by the uri() method.
I used the Uri::builder() to form the return value of the method.

I tested it with a simple handler which returns the uri:

grafik
grafik

Thats basically it. If there is any information missing, please let me know!

Cheers,

Timo

Closes #2895

@robjtede robjtede added B-semver-minor A-web project: actix-web labels Aug 3, 2023
@robjtede robjtede added this to the actix-web v4.5 milestone Aug 3, 2023
@robjtede robjtede removed this from the actix-web v4.5 milestone Feb 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-web project: actix-web B-semver-minor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Request.uri() returns the Path instead of the full URL
2 participants