allowDynamicBackends

Functionin experimental@fastly/js-compute 4.0.0
Deprecated: Use enforceExplicitBackends instead.

Control whether or not Dynamic Backends are allowed within this Fastly Compute service.

By default, Dynamic Backends are disabled within a JavaScript application as it can be a potential avenue for third-party JavaScript code to send requests, potentially including sensitive/secret data, off to destinations that the JavaScript project was not intending, which could be a security issue.

Note: This feature is disabled by default for Fastly Services. Please contact Fastly Support to request the feature be enabled on the Fastly Services which require Dynamic Backends.

Overload 1 of 2

allowDynamicBackends(enabled: boolean): void
View source

Control whether or not Dynamic Backends are allowed within this Fastly Compute service.

By default, Dynamic Backends are disabled within a JavaScript application as it can be a potential avenue for third-party JavaScript code to send requests, potentially including sensitive/secret data, off to destinations that the JavaScript project was not intending, which could be a security issue.

Note: This feature is disabled by default for Fastly Services. Please contact Fastly Support to request the feature be enabled on the Fastly Services which require Dynamic Backends.

Parameters

enabled: boolean

Whether or not to allow Dynamic Backends.

Returns

void

Overload 2 of 2

allowDynamicBackends(defaultConfig: { connectTimeout?: number; firstByteTimeout?: number; betweenBytesTimeout?: number }): void
View source

Enable Dynamic Backends with default timeout configuration.

Parameters

defaultConfig: { connectTimeout?: number; firstByteTimeout?: number; betweenBytesTimeout?: number }

Default timeout configuration for dynamic backends.

  • connectTimeout optional: number — Maximum duration in milliseconds to wait for a connection to be established.
  • firstByteTimeout optional: number — Maximum duration in milliseconds to wait for the server response to begin after a TCP connection is established and the request has been sent.
  • betweenBytesTimeout optional: number — Maximum duration in milliseconds that Fastly will wait while receiving no data on a download from a backend.

Returns

void

Throws

  • RangeError if any timeout value is negative or greater than or equal to 2^32.