mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-04-27 03:00:12 -04:00
Don't include pixel tracker URL in response headers if not enabled.
If the tracker URL isn't configured, we shouldn't include the header in the response. This uses the same criteria (truthiness of g.tracker_url) as the templates to determine whether or not to include the URL.
This commit is contained in:
@@ -1661,7 +1661,7 @@ class RedditController(OAuth2ResourceController):
|
||||
g.stats.simple_event('cors.api_request')
|
||||
g.stats.count_string('origins', request_origin)
|
||||
|
||||
if request.method.upper() == "GET" and is_api():
|
||||
if g.tracker_url and request.method.upper() == "GET" and is_api():
|
||||
tracking_url = make_url_https(get_pageview_pixel_url())
|
||||
response.headers["X-Reddit-Tracking"] = tracking_url
|
||||
|
||||
|
||||
Reference in New Issue
Block a user