Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
guybedford committed Oct 3, 2024
1 parent d90ec12 commit cbd13eb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion runtime/fastly/builtins/fetch/request-response.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1796,7 +1796,7 @@ JSObject *Request::create(JSContext *cx, JS::HandleObject requestInstance, JS::H
if (!url_instance)
return nullptr;

JS::RootedObject parsedURL(cx, URL::create(cx, url_instance, input, WorkerLocation::url));
JS::RootedObject parsedURL(cx, URL::create(cx, url_instance, input, builtins::Fastly::baseURL));

// 2. If `parsedURL` is failure, then throw a `TypeError`.
if (!parsedURL) {
Expand Down
3 changes: 1 addition & 2 deletions tests/wpt-harness/post-harness.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
/* eslint-env serviceworker */
/* global add_completion_callback setup done */
import { enableDebugLogging, setDefaultBackend, setBaseURL } from "fastly:experimental";
import { enableDebugLogging, setBaseURL } from "fastly:experimental";

enableDebugLogging(true);
setDefaultBackend("wpt");

let completionPromise = new Promise((resolve) => {
add_completion_callback(function(tests, harness_status, asserts) {
Expand Down
7 changes: 7 additions & 0 deletions types/experimental.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ declare module "fastly:experimental" {
*/
export function setBaseURL(base: URL | null | undefined): void;
/**
*
* Set the default backend to use when dynamic backends are disabled.
*
* For backwards compatibility, unless allowDynamicBackends has been explicitly
* called before invoking this function, it will disable dynamic backends when it is called
* in order to apply, as if calling allowDynamicBackends(false).
*
* @experimental
*/
export function setDefaultBackend(backend: string): void;
Expand Down

0 comments on commit cbd13eb

Please sign in to comment.