glitch-javascript-sdk 3.9.2 → 3.9.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5787,8 +5787,16 @@
5787
5787
  static aiInstructions(title_id, site_id, data = {}) {
5788
5788
  return Requests.processRoute(HostingRoute.routes.aiInstructions, data, { title_id, site_id });
5789
5789
  }
5790
- static resolve(hostname) {
5791
- return Requests.processRoute(HostingRoute.routes.resolve, undefined, undefined, { hostname });
5790
+ static resolve(hostname, gatewayToken) {
5791
+ if (!gatewayToken) {
5792
+ return Requests.processRoute(HostingRoute.routes.resolve, undefined, undefined, { hostname });
5793
+ }
5794
+ const base = (Config.getBaseUrl() || '').replace(/\/+$/, '');
5795
+ const path = HostingRoute.routes.resolve.url.replace(/^\/+/, '');
5796
+ return axios$1.get(`${base}/${path}`, {
5797
+ params: { hostname },
5798
+ headers: { 'X-Glitch-Hosting-Gateway': gatewayToken },
5799
+ });
5792
5800
  }
5793
5801
  static startPlaySession(data) {
5794
5802
  return Requests.processRoute(HostingRoute.routes.startPlaySession, data);