Skip to content

Commit 8ce6ce2

Browse files
committed
Add notes about testing required headers
1 parent 0817c9b commit 8ce6ce2

File tree

2 files changed

+31
-9
lines changed

2 files changed

+31
-9
lines changed

README.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,20 @@ Run `./code-marketplace --help` for a full list of options.
4242
### Exposing the marketplace
4343

4444
The marketplace must be put behind TLS otherwise code-server will reject
45-
connecting to the API. This could mean using a reverse proxy like NGINX or Caddy
46-
with your own domain and certificates or using a service like Cloudflare.
45+
connecting to the API. This could mean using a TLS-terminating reverse proxy
46+
like NGINX or Caddy with your own domain and certificates or using a service
47+
like Cloudflare.
4748

4849
When hosting the marketplace behind a reverse proxy set either the `Forwarded`
49-
header or both the `X-Forwarded-Host` and `X-Forwarded-Proto` headers. These are
50-
used to generate absolute URLs to extension assets in API responses.
50+
header or both the `X-Forwarded-Host` and `X-Forwarded-Proto` headers. These
51+
headers are used to generate absolute URIs to extension assets in API responses.
52+
One way to test this is to make a query and check one of the URIs in the
53+
response:
54+
55+
```
56+
$ curl 'https://example.com/api/extensionquery' -H 'Accept: application/json;api-version=3.0-preview.1' --compressed -H 'Content-Type: application/json' --data-raw '{"filters":[{"criteria":[{"filterType":8,"value":"Microsoft.VisualStudio.Code"}],"pageSize":1}],"flags":439}' | jq .results[0].extensions[0].versions[0].assetUri
57+
"https://example.com/assets/vscodevim/vim/1.24.1"
58+
```
5159

5260
The marketplace does not support being hosted behind a base path; it must be
5361
proxied at the root of your domain.

helm/README.md

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,28 @@ You will need to configure `ingress` in [values.yaml](./values.yaml) to expose t
1818
marketplace on an external domain or change `service.type` to get yourself an
1919
external IP address.
2020

21-
It is recommended to configure `ingress` with TLS or put the external IP behind
22-
a TLS-terminating reverse proxy because code-server will refuse to connect to
23-
the marketplace if it is not behind HTTPS.
21+
The marketplace must be put behind TLS otherwise code-server will reject
22+
connecting to the API. This could mean configuring `ingress` with TLS or putting
23+
the external IP behind a TLS-terminating reverse proxy.
2424

2525
More information can be found at these links:
2626

27-
https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types
28-
https://kubernetes.io/docs/concepts/services-networking/ingress/
27+
- https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types
28+
- https://kubernetes.io/docs/concepts/services-networking/ingress/
29+
30+
When hosting the marketplace behind a reverse proxy set either the `Forwarded`
31+
header or both the `X-Forwarded-Host` and `X-Forwarded-Proto` headers (the
32+
default `ingress` already takes care of this). These headers are used to
33+
generate absolute URIs to extension assets in API responses. One way to test
34+
this is to make a query and check one of the URIs in the response:
35+
36+
```
37+
$ curl 'https://example.com/api/extensionquery' -H 'Accept: application/json;api-version=3.0-preview.1' --compressed -H 'Content-Type: application/json' --data-raw '{"filters":[{"criteria":[{"filterType":8,"value":"Microsoft.VisualStudio.Code"}],"pageSize":1}],"flags":439}' | jq .results[0].extensions[0].versions[0].assetUri
38+
"https://example.com/assets/vscodevim/vim/1.24.1"
39+
```
40+
41+
The marketplace does not support being hosted behind a base path; it must be
42+
proxied at the root of your domain.
2943

3044
## Adding/removing extensions
3145

0 commit comments

Comments
 (0)