actix-web icon indicating copy to clipboard operation
actix-web copied to clipboard

implemented function which returns full uri

Open TimoCak opened this issue 2 years ago • 0 comments

PR Checklist

  • [x] Tests for the changes have been added / updated.
  • [x] Documentation comments have been added / updated.
  • [x] A changelog entry has been made for the appropriate packages.
  • [x] 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

TimoCak avatar Aug 02 '23 18:08 TimoCak