Skip to content

Commit 6484b56

Browse files
authored
Merge pull request readthedocs#6355 from readthedocs/change-proxied-api-default
Change the default of proxied_api_host to api_host
2 parents a8611aa + 54b8a92 commit 6484b56

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

readthedocs/core/static-src/core/js/doc-embed/footer.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,17 @@ function init() {
6262
get_data['subproject'] = true;
6363
}
6464

65+
// Check for new logic around proxying requests.
66+
// ``proxied_api_host`` won't exist on existing built docs,
67+
// so default to ``api_host`` in those cases
68+
var real_api_host = rtd.api_host;
69+
if ("proxied_api_host" in rtd) {
70+
real_api_host = rtd.proxied_api_host;
71+
}
72+
6573
// Get footer HTML from API and inject it into the page.
6674
$.ajax({
67-
url: rtd.proxied_api_host + "/api/v2/footer_html/",
75+
url: real_api_host + "/api/v2/footer_html/",
6876
crossDomain: true,
6977
xhrFields: {
7078
withCredentials: true,

readthedocs/core/static-src/core/js/doc-embed/rtd-data.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ function get() {
5353

5454
var defaults = {
5555
api_host: 'https://readthedocs.org',
56-
proxied_api_host: 'https://readthedocs.org',
5756
ad_free: false,
5857
};
5958

0 commit comments

Comments
 (0)