Commit graph

6 commits

Author SHA1 Message Date
rmg-x
0cd4c26ae8 Tests/LibWeb: Fix type for delay_ms property in HTTP echo server
This was mistakenly changed from int -> str in a previous commit:
08b8c88ac3
2024-12-07 15:49:15 +00:00
rmg-x
de595b713d Tests/LibWeb: Allow setting custom reason phrase in HTTP echo server 2024-12-06 06:09:44 +00:00
rmg-x
08b8c88ac3 Tests/LibWeb: Use Optional instead of | None syntax in echo script
The `str | None` syntax is only supported in Python 3.10+ and we can
support more Python versions without compromising readability by
importing the `Optional` type.
2024-12-06 06:09:44 +00:00
rmg-x
e4bc6178b9 Tests/LibWeb: Remove duplicate "headers" property in HTTP echo request 2024-12-06 06:09:44 +00:00
rmg-x
4dd21d0b80 Tests/LibWeb: Refactor HTTP echo server script
This commit makes the following changes:
- Adds a model "Echo" for the request body
- Changes the main endpoint from /create to /echo (more REST-y)
- Sends "400: Bad Request" for invalid params or a reserved path
- Sends "409: Conflict" when trying to use an already registered path
- Prints the server port to stdout
- Removes unnecessary subcommands/options (start, stop, --background)
2024-12-05 17:02:57 -07:00
Cory Virok
97d47a38c9 Meta: Add an HTTP echo server to help with testing Browser JS
This allows us to simulate HTTP responses from Browser JS tests.
Instead of using hacks like data URLs to "load" external data,
we can now generate an actual HTTP response that contains
arbitrary headers, body, and has a defined response delay.
2024-11-09 13:08:31 -07:00