Skip to content

Commit

Permalink
Backup
Browse files Browse the repository at this point in the history
  • Loading branch information
vic-ma committed Jun 17, 2024
1 parent 01a21a5 commit 15966b6
Showing 1 changed file with 8 additions and 36 deletions.
44 changes: 8 additions & 36 deletions course-definition.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,42 +26,14 @@ stages:
name: "Read header"
difficulty: very_easy
description_md: |-
In this stage, you'll add support for [`gzip` compression](https://www.gzip.org/) to your HTTP server.
### Tests
The tester will execute your program like this:
```
$ ./your_server.sh
```
Then, the tester will send a `GET` request to the `/echo/{str}` endpoint on your server. The request will contain an `Accept-Encoding` header that includes `gzip`.
```
$ curl -v -H "Accept-Encoding: gzip" http://localhost:4221/echo/abc | hexdump -C
```
Your server's response must contain the following:
- `200` response code.
- `Content-Type` header set to `text/plain`.
- `Content-Encoding` header set to `gzip`.
- `Content-Length` header set to the size of the compressed body.
- Response body set to the `gzip`-compressed `str` parameter.
```
HTTP/1.1 200 OK
Content-Encoding: gzip
Content-Type: text/plain
Content-Length: 23
1F 8B 08 00 00 00 00 00 // Hexadecimal representation of the response body
00 03 4B 4C 4A 06 00 C2
41 24 35 03 00 00 00
```
### Notes
- To check that your compressed body is correct, you can run `echo -n <uncompressed-str> | gzip | hexdump -C`.
- It's normal for a very short string like `abc` to increase in size when compressed.
TEST:
- adfoiajdsfoiadsjf adsfadsfdafadfoiajdsfoiadsjf adsfadsfdafadfoiajdsfoiadsjf adsfadsfdafadfoiajdsfoiadsjf adsfadsfdafadfoiajdsfoiadsjf adsfadsfdafadfoiajdsfoiadsjf adsfadsfdafadfoiajdsfoiadsjf adsfadsfdaf
SECOND LINE
- dsafdsafads
```
fadsfadf
```
- fdasfdsafsad
marketing_md: |-
In this stage, we'll do XYZ.
Expand Down

0 comments on commit 15966b6

Please sign in to comment.