Skip to content

Implemented req.completeUrl #4958

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

Johan511
Copy link

Added new getter completeUrl to req object as discussed in #4697

  1. should I make any changes?
  2. should I try adding any test cases?

@Johan511 Johan511 changed the title #4697 => implemented req.completeUrl, todo Implemented req.completeUrl Jul 18, 2022
@@ -449,11 +449,15 @@ defineGetter(req, 'hostname', function hostname(){
: host;
});

// TODO: change req.host to return host in next major
defineGetter(req, 'completeUrl', function completeUrl(){
return req.protocol + '://' + req.get('host') + req.originalUrl;
Copy link

@bozzelliandrea bozzelliandrea Jul 19, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Johan511, i'm just thinking about a crud api set, the completeUrl function probably need to manage some parameters or subroute,
examples:

- http://myhost/user/1
- http://myhost/user/1/detail
- http://myhost/user/1/detail/summary

so the question is, is this method really usable? or the purpose is just to have one base url?
Can you please implements some tests to really understand the functionality?

@dougwilson dougwilson force-pushed the master branch 2 times, most recently from eb10dba to 340be0f Compare October 6, 2022 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants