Skip to content

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 Jul 18, 2022

// 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

3 participants