From 85c4379431ae47255409eafdf18ce9da195e57be Mon Sep 17 00:00:00 2001 From: vil02 <65706193+vil02@users.noreply.github.com> Date: Tue, 18 Feb 2025 21:42:50 +0100 Subject: [PATCH] [Workers] Remove trailing spaces --- src/content/docs/workers/platform/known-issues.mdx | 4 ++-- src/content/docs/workers/reference/security-model.mdx | 4 ++-- src/content/docs/workers/runtime-apis/context.mdx | 4 ++-- src/content/docs/workers/runtime-apis/handlers/tail.mdx | 2 +- .../docs/workers/runtime-apis/nodejs/string-decoder.mdx | 2 +- src/content/docs/workers/runtime-apis/nodejs/util.mdx | 2 +- src/content/docs/workers/runtime-apis/response.mdx | 2 +- .../runtime-apis/streams/readablestreamdefaultreader.mdx | 2 +- .../docs/workers/runtime-apis/streams/writablestream.mdx | 2 +- .../runtime-apis/streams/writablestreamdefaultwriter.mdx | 2 +- src/content/docs/workers/runtime-apis/tcp-sockets.mdx | 2 +- src/content/docs/workers/runtime-apis/web-crypto.mdx | 2 +- .../tutorials/connect-to-turso-using-workers/index.mdx | 2 +- src/content/docs/workers/wrangler/configuration.mdx | 2 +- 14 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/content/docs/workers/platform/known-issues.mdx b/src/content/docs/workers/platform/known-issues.mdx index ce25a4cf3130cb6..d85c5eb5ae22ec4 100644 --- a/src/content/docs/workers/platform/known-issues.mdx +++ b/src/content/docs/workers/platform/known-issues.mdx @@ -33,8 +33,8 @@ You will notice that all examples trigger Worker B. This includes the final exam When adding a wildcard on a subdomain, here are how the following URLs will be resolved: ``` -// (A) *.example.com/a -// (B) a.example.com/* +// (A) *.example.com/a +// (B) a.example.com/* "a.example.com/a" // -> B diff --git a/src/content/docs/workers/reference/security-model.mdx b/src/content/docs/workers/reference/security-model.mdx index 4d0e9e82352a858..df13f06579ed732 100644 --- a/src/content/docs/workers/reference/security-model.mdx +++ b/src/content/docs/workers/reference/security-model.mdx @@ -178,7 +178,7 @@ The values of `start` and `end` will always be exactly the same. The attacker ca :::note -This measure was implemented in mid-2017, before Spectre was announced. This measure was implemented because Cloudflare was already concerned about side channel timing attacks. The Workers team has designed the system with side channels in mind. +This measure was implemented in mid-2017, before Spectre was announced. This measure was implemented because Cloudflare was already concerned about side channel timing attacks. The Workers team has designed the system with side channels in mind. ::: Similarly, multi-threading and shared memory are not permitted in Workers. Everything related to the processing of one event happens on the same thread. Otherwise, one would be able to race threads in order to guess and check the underlying timer. Multiple Workers are not allowed to operate on the same request concurrently. For example, if you have installed a Cloudflare App on your zone which is implemented using Workers, and your zone itself also uses Workers, then a request to your zone may actually be processed by two Workers in sequence. These run in the same thread. @@ -187,7 +187,7 @@ At this point, measuring code execution time locally is prevented. However, it c :::note -It has been suggested that if Workers reset its execution environment on every request, that Workers would be in a much safer position against timing attacks. Unfortunately, it is not so simple. The execution state could be stored in a client — not the Worker itself — allowing a Worker to resume its previous state on every new request. +It has been suggested that if Workers reset its execution environment on every request, that Workers would be in a much safer position against timing attacks. Unfortunately, it is not so simple. The execution state could be stored in a client — not the Worker itself — allowing a Worker to resume its previous state on every new request. ::: In adversarial testing and with help from leading Spectre experts, Cloudflare has not been able to develop a remote timing attack that works in production. However, the lack of a working attack does not mean that Workers should stop building defenses. Instead, the Workers team is currently testing some more advanced measures. diff --git a/src/content/docs/workers/runtime-apis/context.mdx b/src/content/docs/workers/runtime-apis/context.mdx index 5f0d62182efe7fa..b85b5407018e644 100644 --- a/src/content/docs/workers/runtime-apis/context.mdx +++ b/src/content/docs/workers/runtime-apis/context.mdx @@ -27,7 +27,7 @@ Context is exposed via the following places: If you are using `waitUntil()` to emit logs or exceptions, we recommend using [Tail Workers](/workers/observability/logs/tail-workers/) instead. Even if your Worker throws an uncaught exception, the Tail Worker will execute, ensuring that you can emit logs or exceptions regardless of the Worker's invocation status. -[Cloudflare Queues](/queues/) is purpose-built for performing work out-of-band, without blocking returning a response back to the client Worker. +[Cloudflare Queues](/queues/) is purpose-built for performing work out-of-band, without blocking returning a response back to the client Worker. ::: You can call `waitUntil()` multiple times. Similar to `Promise.allSettled`, even if a promise passed to one `waitUntil` call is rejected, promises passed to other `waitUntil()` calls will still continue to execute. @@ -60,7 +60,7 @@ export default { The Workers Runtime uses streaming for request and response bodies. It does not buffer the body. Hence, if an exception occurs after the body has been consumed, `passThroughOnException()` cannot send the body again. -If this causes issues, we recommend cloning the request body and handling exceptions in code. This will protect against uncaught code exceptions. However some exception times such as exceed CPU or memory limits will not be mitigated. +If this causes issues, we recommend cloning the request body and handling exceptions in code. This will protect against uncaught code exceptions. However some exception times such as exceed CPU or memory limits will not be mitigated. ::: The `passThroughOnException` method allows a Worker to [fail open](https://community.microfocus.com/cyberres/b/sws-22/posts/security-fundamentals-part-1-fail-open-vs-fail-closed), and pass a request through to an origin server when a Worker throws an unhandled exception. This can be useful when using Workers as a layer in front of an existing service, allowing the service behind the Worker to handle any unexpected error cases that arise in your Worker. diff --git a/src/content/docs/workers/runtime-apis/handlers/tail.mdx b/src/content/docs/workers/runtime-apis/handlers/tail.mdx index 8f400ea6f11d60d..c79096b19d91597 100644 --- a/src/content/docs/workers/runtime-apis/handlers/tail.mdx +++ b/src/content/docs/workers/runtime-apis/handlers/tail.mdx @@ -109,7 +109,7 @@ export default { Outcome is equivalent to the exit status of a script and an indicator of whether it has fully run to completion. A Worker outcome may differ from a response code if, for example: * a script successfully processes a request but is logically designed to return a `4xx`/`5xx` response. -* a script sends a successful `200` response but an asynchronous task registered via `waitUntil()` later exceeds CPU or memory limits. +* a script sends a successful `200` response but an asynchronous task registered via `waitUntil()` later exceeds CPU or memory limits. ::: ### `FetchEventInfo` diff --git a/src/content/docs/workers/runtime-apis/nodejs/string-decoder.mdx b/src/content/docs/workers/runtime-apis/nodejs/string-decoder.mdx index 1bc35f1536b61f9..6301917952f0ad5 100644 --- a/src/content/docs/workers/runtime-apis/nodejs/string-decoder.mdx +++ b/src/content/docs/workers/runtime-apis/nodejs/string-decoder.mdx @@ -11,7 +11,7 @@ import { Render } from "~/components" The [`node:string_decoder`](https://nodejs.org/api/string_decoder.html) is a legacy utility module that predates the WHATWG standard [TextEncoder](/workers/runtime-apis/encoding/#textencoder) and [TextDecoder](/workers/runtime-apis/encoding/#textdecoder) API. In most cases, you should use `TextEncoder` and `TextDecoder` instead. `StringDecoder` is available in the Workers runtime primarily for compatibility with existing npm packages that rely on it. `StringDecoder` can be accessed using: ```js -const { StringDecoder } = require('node:string_decoder'); +const { StringDecoder } = require('node:string_decoder'); const decoder = new StringDecoder('utf8'); const cent = Buffer.from([0xC2, 0xA2]); diff --git a/src/content/docs/workers/runtime-apis/nodejs/util.mdx b/src/content/docs/workers/runtime-apis/nodejs/util.mdx index ed282a4dc6129e8..4d3f146b0f5f826 100644 --- a/src/content/docs/workers/runtime-apis/nodejs/util.mdx +++ b/src/content/docs/workers/runtime-apis/nodejs/util.mdx @@ -73,7 +73,7 @@ types.isAsyncFunction(async function foo() {}); // Returns true :::caution -The Workers implementation currently does not provide implementations of the `util.types.isExternal()`, `util.types.isProxy()`, `util.types.isKeyObject()`, or `util.type.isWebAssemblyCompiledModule()` APIs. +The Workers implementation currently does not provide implementations of the `util.types.isExternal()`, `util.types.isProxy()`, `util.types.isKeyObject()`, or `util.type.isWebAssemblyCompiledModule()` APIs. ::: For more about `util.types`, refer to the [Node.js documentation for `util.types`](https://nodejs.org/dist/latest-v19.x/docs/api/util.html#utiltypes). diff --git a/src/content/docs/workers/runtime-apis/response.mdx b/src/content/docs/workers/runtime-apis/response.mdx index 64daf89c59b41cc..ea4f97403354bd3 100644 --- a/src/content/docs/workers/runtime-apis/response.mdx +++ b/src/content/docs/workers/runtime-apis/response.mdx @@ -36,7 +36,7 @@ let response = new Response(body, init); -Valid options for the `options` object include: +Valid options for the `options` object include: * `cf` any | null * An object that contains Cloudflare-specific information. This object is not part of the Fetch API standard and is only available in Cloudflare Workers. This field is only used by consumers of the Response for informational purposes and does not have any impact on Workers behavior. diff --git a/src/content/docs/workers/runtime-apis/streams/readablestreamdefaultreader.mdx b/src/content/docs/workers/runtime-apis/streams/readablestreamdefaultreader.mdx index 4e13e9ad540bb8a..c532a28655ca485 100644 --- a/src/content/docs/workers/runtime-apis/streams/readablestreamdefaultreader.mdx +++ b/src/content/docs/workers/runtime-apis/streams/readablestreamdefaultreader.mdx @@ -46,7 +46,7 @@ const reader = readable.getReader(); :::caution[Warning] - Any data not yet read is lost. + Any data not yet read is lost. ::: * `releaseLock()` : void diff --git a/src/content/docs/workers/runtime-apis/streams/writablestream.mdx b/src/content/docs/workers/runtime-apis/streams/writablestream.mdx index 4251c77ae0c36fe..e099dbf3415db57 100644 --- a/src/content/docs/workers/runtime-apis/streams/writablestream.mdx +++ b/src/content/docs/workers/runtime-apis/streams/writablestream.mdx @@ -46,7 +46,7 @@ Refer to the [WritableStreamDefaultWriter](/workers/runtime-apis/streams/writabl :::caution[Warning] - Any data not yet written is lost upon abort. + Any data not yet written is lost upon abort. ::: * `getWriter()` : WritableStreamDefaultWriter diff --git a/src/content/docs/workers/runtime-apis/streams/writablestreamdefaultwriter.mdx b/src/content/docs/workers/runtime-apis/streams/writablestreamdefaultwriter.mdx index 50af06532839760..971632ea97354bf 100644 --- a/src/content/docs/workers/runtime-apis/streams/writablestreamdefaultwriter.mdx +++ b/src/content/docs/workers/runtime-apis/streams/writablestreamdefaultwriter.mdx @@ -50,7 +50,7 @@ writeArrayToStream([1, 2, 3, 4, 5], writableStream) :::caution[Warning] - Any data not yet written is lost upon abort. + Any data not yet written is lost upon abort. ::: * `close()` : Promise\ diff --git a/src/content/docs/workers/runtime-apis/tcp-sockets.mdx b/src/content/docs/workers/runtime-apis/tcp-sockets.mdx index e3c7987d7b56367..f89b50a1ad82301 100644 --- a/src/content/docs/workers/runtime-apis/tcp-sockets.mdx +++ b/src/content/docs/workers/runtime-apis/tcp-sockets.mdx @@ -12,7 +12,7 @@ Many application-layer protocols are built on top of the Transmission Control Pr :::note -Connecting to a PostgreSQL database? You should use [Hyperdrive](/hyperdrive/), which provides the `connect()` API with built-in connection pooling and query caching. +Connecting to a PostgreSQL database? You should use [Hyperdrive](/hyperdrive/), which provides the `connect()` API with built-in connection pooling and query caching. ::: :::note diff --git a/src/content/docs/workers/runtime-apis/web-crypto.mdx b/src/content/docs/workers/runtime-apis/web-crypto.mdx index c3ff065c97adb65..a185c6c9986241c 100644 --- a/src/content/docs/workers/runtime-apis/web-crypto.mdx +++ b/src/content/docs/workers/runtime-apis/web-crypto.mdx @@ -33,7 +33,7 @@ Some common uses include [signing requests](/workers/examples/signing-requests/) :::caution -The Web Crypto API differs significantly from the [Node.js Crypto API](/workers/runtime-apis/nodejs/crypto/). If you are working with code that relies on the Node.js Crypto API, you can use it by enabling the [`nodejs_compat` compatibility flag](/workers/runtime-apis/nodejs/). +The Web Crypto API differs significantly from the [Node.js Crypto API](/workers/runtime-apis/nodejs/crypto/). If you are working with code that relies on the Node.js Crypto API, you can use it by enabling the [`nodejs_compat` compatibility flag](/workers/runtime-apis/nodejs/). ::: *** diff --git a/src/content/docs/workers/tutorials/connect-to-turso-using-workers/index.mdx b/src/content/docs/workers/tutorials/connect-to-turso-using-workers/index.mdx index af48ce3deadf4b2..f079f019afba386 100644 --- a/src/content/docs/workers/tutorials/connect-to-turso-using-workers/index.mdx +++ b/src/content/docs/workers/tutorials/connect-to-turso-using-workers/index.mdx @@ -130,7 +130,7 @@ cd worker-turso-ts In your project directory, you now have the following files: -- `wrangler.json` / `wrangler.toml`: [Wrangler configuration file](/workers/wrangler/configuration/) +- `wrangler.json` / `wrangler.toml`: [Wrangler configuration file](/workers/wrangler/configuration/) - `src/index.ts`: A minimal Hello World Worker written in TypeScript - `package.json`: A minimal Node dependencies configuration file. - `tsconfig.json`: TypeScript configuration that includes Workers types. Only generated if indicated. diff --git a/src/content/docs/workers/wrangler/configuration.mdx b/src/content/docs/workers/wrangler/configuration.mdx index 0b01ec1f274fab0..8111f1e75abfa42 100644 --- a/src/content/docs/workers/wrangler/configuration.mdx +++ b/src/content/docs/workers/wrangler/configuration.mdx @@ -1306,7 +1306,7 @@ A common example of using a redirected configuration is where a custom build too binding = "" id = "" ``` - + Note that this configuration points `main` at the user's code entry-point.