Re: [Django] #25211: Add USE_X_FORWARDED_PORT setting and HttpRequest.get_port()

2015-08-04 Thread Django
#25211: Add USE_X_FORWARDED_PORT setting and HttpRequest.get_port()
-+-
 Reporter:  mattrobenolt |Owner:  nobody
 Type:  New feature  |   Status:  closed
Component:  HTTP handling|  Version:  master
 Severity:  Normal   |   Resolution:  fixed
 Keywords:  port, server_port,   | Triage Stage:  Ready for
  proxy  |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Tim Graham ):

 * status:  new => closed
 * resolution:   => fixed


Comment:

 In [changeset:"4dcfbd792342667174834c40e792f1b8ac2f0609" 4dcfbd79]:
 {{{
 #!CommitTicketReference repository=""
 revision="4dcfbd792342667174834c40e792f1b8ac2f0609"
 Fixed #25211 -- Added HttpRequest.get_port() and USE_X_FORWARDED_PORT
 setting.
 }}}

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/070.18c80c9abc29dbc29a2dc15705350c2f%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #25211: Add USE_X_FORWARDED_PORT setting and HttpRequest.get_port()

2015-08-03 Thread Django
#25211: Add USE_X_FORWARDED_PORT setting and HttpRequest.get_port()
-+-
 Reporter:  mattrobenolt |Owner:  nobody
 Type:  New feature  |   Status:  new
Component:  HTTP handling|  Version:  master
 Severity:  Normal   |   Resolution:
 Keywords:  port, server_port,   | Triage Stage:  Ready for
  proxy  |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by charettes):

 * stage:  Accepted => Ready for checkin


--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/070.399adf4c5b7e482b74b965d080d57d57%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #25211: Add USE_X_FORWARDED_PORT setting and HttpRequest.get_port()

2015-08-03 Thread Django
#25211: Add USE_X_FORWARDED_PORT setting and HttpRequest.get_port()
-+-
 Reporter:  mattrobenolt |Owner:  nobody
 Type:  New feature  |   Status:  new
Component:  HTTP handling|  Version:  master
 Severity:  Normal   |   Resolution:
 Keywords:  port, server_port,   | Triage Stage:  Accepted
  proxy  |
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by mattrobenolt):

 * needs_docs:   => 0
 * needs_better_patch:   => 0
 * needs_tests:   => 0
 * stage:  Unreviewed => Accepted


--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/070.0cfc5f8b3dc107f844651399ee13ccbe%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


[Django] #25211: Add USE_X_FORWARDED_PORT setting and HttpRequest.get_port()

2015-08-03 Thread Django
#25211: Add USE_X_FORWARDED_PORT setting and HttpRequest.get_port()
---+--
 Reporter:  mattrobenolt   |  Owner:  nobody
 Type:  New feature| Status:  new
Component:  HTTP handling  |Version:  master
 Severity:  Normal |   Keywords:  port, server_port, proxy
 Triage Stage:  Unreviewed |  Has patch:  1
Easy pickings:  0  |  UI/UX:  0
---+--
 It's be nice to internally have a way to reference the "real" port number
 when behind a proxy.

 Today, as an example:

 If you were running a load balancer on port 80, which proxied back to an
 nginx which was running on 8080, it's possible that `get_host()` would
 resolve your request back to `example.com:8080` instead of the proper
 `example.com` since `SERVER_PORT` is coming from what nginx was listening
 on.

 This just adds a proper method to `get_port()` and respect an optional `X
 -Forwarded-Port` header.

 The benefits of this being internal to Django, is because anywhere that
 Django tries to resolve the port internally, we should be utilizing this
 method. This issue is easy to correct in user-land, but a bit harder when
 an internal Django method utilizes `SERVER_PORT` directly. The only option
 is to have a middleware which sets `request.META['SERVER_PORT'] =
 request.META['HTTP_X_FORWARDED_PORT']` which is less than ideal IMO since
 it's overloading the meaning of the variable.

 This is also relevant for https://github.com/django/django/pull/4337 since
 in the wild, we hit an issue with `SERVER_PORT` not reflecting what the
 upstream actually was, which caused issues. So this would unify and make
 https://github.com/django/django/pull/4337 leverage the new `get_port()`.

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/055.679d2690809b7214a85506da40c26ebe%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.