Skip to content

Commit 1e5dfe2

Browse files
committed
Changelog and update to version 34
1 parent b10e3f6 commit 1e5dfe2

File tree

3 files changed

+18
-17
lines changed

3 files changed

+18
-17
lines changed

CHANGELOG.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11

2-
## Version `34` - `2024-08-11`
2+
## Version `34` - `2024-08-17`
33
* Set `PRESERVE_HEADER_CASE` to `1` to attempt to preserve the case of headers in the response.
4+
* Set `OVERRIDE_RESPONSE_BODY_FILE_PATH` to a path, to override the response body with the contents of that file.
45

56
## Version `33` - `2024-04-07`
67
* Implementing configurable CORS settings by [ash0ne](https://github.com/mendhak/docker-http-https-echo/pull/65).

README.md

+15-15
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ It comes with various options that can manipulate the response output, see the t
88

99
![browser](./screenshots/screenshot.png)
1010

11-
The image is available on [Docker Hub](https://hub.docker.com/r/mendhak/http-https-echo): `mendhak/http-https-echo:33`
12-
The image is available on [Github Container Registry](https://github.com/mendhak/docker-http-https-echo/pkgs/container/http-https-echo): `ghcr.io/mendhak/http-https-echo:33`
11+
The image is available on [Docker Hub](https://hub.docker.com/r/mendhak/http-https-echo): `mendhak/http-https-echo:34`
12+
The image is available on [Github Container Registry](https://github.com/mendhak/docker-http-https-echo/pkgs/container/http-https-echo): `ghcr.io/mendhak/http-https-echo:34`
1313

1414
Please do not use the `:latest` tag as it will break without warning, use a specific version instead.
1515

@@ -44,7 +44,7 @@ This image is executed as non root by default and is fully compliant with Kubern
4444

4545
Run with Docker
4646

47-
docker run -p 8080:8080 -p 8443:8443 --rm -t mendhak/http-https-echo:33
47+
docker run -p 8080:8080 -p 8443:8443 --rm -t mendhak/http-https-echo:34
4848

4949
Or run with Docker Compose
5050

@@ -61,13 +61,13 @@ You can choose a different internal port instead of 8080 and 8443 with the `HTTP
6161

6262
In this example I'm setting http to listen on 8888, and https to listen on 9999.
6363

64-
docker run -e HTTP_PORT=8888 -e HTTPS_PORT=9999 -p 8080:8888 -p 8443:9999 --rm -t mendhak/http-https-echo:33
64+
docker run -e HTTP_PORT=8888 -e HTTPS_PORT=9999 -p 8080:8888 -p 8443:9999 --rm -t mendhak/http-https-echo:34
6565

6666

6767
With docker compose, this would be:
6868

6969
my-http-listener:
70-
image: mendhak/http-https-echo:33
70+
image: mendhak/http-https-echo:34
7171
environment:
7272
- HTTP_PORT=8888
7373
- HTTPS_PORT=9999
@@ -83,7 +83,7 @@ The certificates are at `/app/fullchain.pem` and `/app/privkey.pem`.
8383
You can use volume mounting to substitute the certificate and private key with your own.
8484

8585
my-http-listener:
86-
image: mendhak/http-https-echo:33
86+
image: mendhak/http-https-echo:34
8787
ports:
8888
- "8080:8080"
8989
- "8443:8443"
@@ -98,7 +98,7 @@ You can use the environment variables `HTTPS_CERT_FILE` and `HTTPS_KEY_FILE` to
9898

9999
If you specify the header that contains the JWT, the echo output will contain the decoded JWT. Use the `JWT_HEADER` environment variable for this.
100100

101-
docker run -e JWT_HEADER=Authentication -p 8080:8080 -p 8443:8443 --rm -it mendhak/http-https-echo:33
101+
docker run -e JWT_HEADER=Authentication -p 8080:8080 -p 8443:8443 --rm -it mendhak/http-https-echo:34
102102

103103

104104
Now make your request with `Authentication: eyJ...` header (it should also work with the `Authentication: Bearer eyJ...` schema too):
@@ -111,21 +111,21 @@ And in the output you should see a `jwt` section.
111111

112112
In the log output set the environment variable `DISABLE_REQUEST_LOGS` to true, to disable the specific ExpressJS request log lines. The ones like `::ffff:172.17.0.1 - - [03/Jan/2022:21:31:51 +0000] "GET /xyz HTTP/1.1" 200 423 "-" "curl/7.68.0"`. The JSON output will still appear.
113113

114-
docker run --rm -e DISABLE_REQUEST_LOGS=true --name http-echo-tests -p 8080:8080 -p 8443:8443 -t mendhak/http-https-echo:33
114+
docker run --rm -e DISABLE_REQUEST_LOGS=true --name http-echo-tests -p 8080:8080 -p 8443:8443 -t mendhak/http-https-echo:34
115115

116116

117117
## Do not log specific path
118118

119119
Set the environment variable `LOG_IGNORE_PATH` to a path you would like to exclude from verbose logging to stdout.
120120
This can help reduce noise from healthchecks in orchestration/infrastructure like Swarm, Kubernetes, ALBs, etc.
121121

122-
docker run -e LOG_IGNORE_PATH=/ping -p 8080:8080 -p 8443:8443 --rm -t mendhak/http-https-echo:33
122+
docker run -e LOG_IGNORE_PATH=/ping -p 8080:8080 -p 8443:8443 --rm -t mendhak/http-https-echo:34
123123

124124

125125
With docker compose, this would be:
126126

127127
my-http-listener:
128-
image: mendhak/http-https-echo:33
128+
image: mendhak/http-https-echo:34
129129
environment:
130130
- LOG_IGNORE_PATH=/ping
131131
ports:
@@ -156,15 +156,15 @@ Will contain a `json` property in the response/output.
156156
You can disable new lines in the log output by setting the environment variable `LOG_WITHOUT_NEWLINE`. For example,
157157

158158
```bash
159-
docker run -e LOG_WITHOUT_NEWLINE=true -p 8080:8080 -p 8443:8443 --rm -t mendhak/http-https-echo:33
159+
docker run -e LOG_WITHOUT_NEWLINE=true -p 8080:8080 -p 8443:8443 --rm -t mendhak/http-https-echo:34
160160
```
161161

162162
## Send an empty response
163163

164164
You can disable the JSON output in the response by setting the environment variable `ECHO_BACK_TO_CLIENT`. For example,
165165

166166
```bash
167-
docker run -e ECHO_BACK_TO_CLIENT=false -p 8080:8080 -p 8443:8443 --rm -t mendhak/http-https-echo:33
167+
docker run -e ECHO_BACK_TO_CLIENT=false -p 8080:8080 -p 8443:8443 --rm -t mendhak/http-https-echo:34
168168
```
169169

170170
## Custom status code
@@ -245,7 +245,7 @@ You can have environment variables (that are visible to the echo server's proces
245245
Pass the `ECHO_INCLUDE_ENV_VARS=1` environment variable in.
246246

247247
```bash
248-
docker run -d --rm -e ECHO_INCLUDE_ENV_VARS=1 --name http-echo-tests -p 8080:8080 -p 8443:8443 -t mendhak/http-https-echo:33
248+
docker run -d --rm -e ECHO_INCLUDE_ENV_VARS=1 --name http-echo-tests -p 8080:8080 -p 8443:8443 -t mendhak/http-https-echo:34
249249
```
250250

251251
Then do a normal request via curl or browser, and you will see the `env` property in the response body.
@@ -285,7 +285,7 @@ openssl pkcs12 -export -in cert.pem -inkey privkey.pem -out certpkcs12.pfx
285285
By default, the headers in the response body are lowercased. To attempt to preserve the case of headers in the response body, set the environment variable `PRESERVE_HEADER_CASE` to true.
286286

287287
```bash
288-
docker run -e PRESERVE_HEADER_CASE=true -p 8080:8080 -p 8443:8443 --rm -t mendhak/http-https-echo:33
288+
docker run -e PRESERVE_HEADER_CASE=true -p 8080:8080 -p 8443:8443 --rm -t mendhak/http-https-echo:34
289289
```
290290

291291
## Override the response body with a file
@@ -294,7 +294,7 @@ To override the response body with a file, set the environment variable `OVERRID
294294
The file path needs to be in the `/app` directory.
295295

296296
```bash
297-
docker run -d --rm -v ${PWD}/test.html:/app/test.html -p 8080:8080 -e OVERRIDE_RESPONSE_BODY_FILE_PATH=/test.html -t mendhak/http-https-echo:33
297+
docker run -d --rm -v ${PWD}/test.html:/app/test.html -p 8080:8080 -e OVERRIDE_RESPONSE_BODY_FILE_PATH=/test.html -t mendhak/http-https-echo:34
298298
```
299299

300300

docker-compose.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: '3'
22
services:
33
my-http-listener:
4-
image: mendhak/http-https-echo:33
4+
image: mendhak/http-https-echo:34
55
environment:
66
- HTTP_PORT=8888
77
- HTTPS_PORT=9999

0 commit comments

Comments
 (0)