This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Add request_origin helper property to c.

  • Loading branch information...
1 parent 41d57da commit a31296f9725b8925d431730d206f3632757dc446 @chromakode chromakode committed Feb 27, 2013
Showing with 3 additions and 0 deletions.
  1. +3 −0 r2/r2/controllers/reddit_base.py
@@ -686,6 +686,9 @@ def pre(self):
if c.secure:
request.environ["wsgi.url_scheme"] = "https"
+ url = urlparse(request.url)
+ c.request_origin = url.scheme + "://" + url.netloc
+
#check if user-agent needs a dose of rate-limiting
if not c.error_page:
ratelimit_throttled()

0 comments on commit a31296f

Please sign in to comment.