From 00d6278211e2fbc799e901524677e17c82cf14ac Mon Sep 17 00:00:00 2001 From: Harsh Mishra Date: Wed, 6 May 2026 19:47:02 +0530 Subject: [PATCH] Document x-localstack header --- .../aws/capabilities/config/configuration.md | 1 + .../networking/internal-endpoints.md | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/src/content/docs/aws/capabilities/config/configuration.md b/src/content/docs/aws/capabilities/config/configuration.md index 77cceb1d..6c2ce255 100644 --- a/src/content/docs/aws/capabilities/config/configuration.md +++ b/src/content/docs/aws/capabilities/config/configuration.md @@ -40,6 +40,7 @@ Options that affect the core LocalStack system. | `SERVICES`| `s3,sqs` | A comma-delimited string of services. Check the [internal health endpoint](/aws/capabilities/networking/internal-endpoints#localstack-endpoints) `/_localstack/health` for valid service names. If `SERVICES` is set LocalStack will only load the listed services. All other services will be disabled and cannot be used. | | `ALLOW_NONSTANDARD_REGIONS` | `0` (default) | Allows the use of non-standard AWS regions. By default, LocalStack only accepts [standard AWS regions](https://docs.aws.amazon.com/general/latest/gr/rande.html). | | `PARITY_AWS_ACCESS_KEY_ID` | `0` (default) | Enables the use production-like access key IDs. By default, LocalStack issues keys with `LSIA...` and `LKIA...` prefix, and will reject keys that start with `ASIA...` or `AKIA...`. | +| `LOCALSTACK_RESPONSE_HEADER_ENABLED` | `1` (default) \| `0` | Whether LocalStack adds the [`x-localstack` response header](/aws/capabilities/networking/internal-endpoints#x-localstack-response-header) to every AWS API response. The header value is the LocalStack version and lets client tools detect LocalStack and its version. | ## CLI diff --git a/src/content/docs/aws/capabilities/networking/internal-endpoints.md b/src/content/docs/aws/capabilities/networking/internal-endpoints.md index 93ceb004..24618f7d 100644 --- a/src/content/docs/aws/capabilities/networking/internal-endpoints.md +++ b/src/content/docs/aws/capabilities/networking/internal-endpoints.md @@ -37,3 +37,21 @@ curl -v --request POST --header "Content-Type: application/json" --data '{"acti The API path for the AWS internal resources is `/_aws`. These endpoints offer LocalStack-specific features in addition to the ones offered by the AWS services. For instance, `/aws/services/sqs/messages` conveniently access all messages within a SQS queue, without deleting them. + +### `x-localstack` response header + +LocalStack adds an `x-localstack` HTTP header to every response served by its AWS gateway. +The header value is the LocalStack version string (for example, `2026.3.1.dev65`), so client tools can detect both that they are talking to LocalStack and which version is running in a single round-trip. + +```bash +curl -s -i http://localhost.localstack.cloud:4566/_localstack/health | grep -i x-localstack +# x-localstack: 2026.3.1.dev65 +``` + +:::note +Before LocalStack `v2026.04`, the header value was the static string `true`. +Starting with `v2026.04`, it returns the LocalStack version instead. +Clients that only check for the *presence* of the header remain compatible. +::: + +The header is enabled by default and can be disabled by setting [`LOCALSTACK_RESPONSE_HEADER_ENABLED`](/aws/capabilities/config/configuration#core) to `0`.