remote: [tester::#IA4] Running tests for Stage #IA4 (Respond with 200)
remote: [tester::#IA4] $ ./your_program.sh
remote: [tester::#IA4] $ curl -v http://localhost:4221/
remote: [your_program] accepted new connection
remote: [tester::#IA4] Failed to read response:
remote: [tester::#IA4] Received: “” (no content received)
remote: [tester::#IA4] ^ error
remote: [tester::#IA4] Error: Expected: HTTP-version, Received: “”
remote: [tester::#IA4] Test failed (try setting ‘debug: true’ in your codecrafters.yml to see more details)
remote:
remote: Try our CLI to run tests faster without Git: How do I install the CLI? - CodeCrafters
remote:
remote: View our article on debugging test failures: How do I debug test failures? - CodeCrafters
remote:
To [redacted by Andy]
No matter how I modify the code and confirm that there is no problem with it, it keeps showing that this test has failed.
Hey @IYHZhu, could you share a screenshot of the code as it looks in your editor?
The current version in the repo (see below) never writes a response, so I’d like to confirm whether there are unsaved local changes or edits not yet committed.
The reason I believe the test case is not succeeding is because you are not returning a valid HTTP response as the error "Expected: HTTP-version, Received: “” suggests. This may happen when your server is not properly responding to an HTTP request or if there was an issue responding to the HTTP request(such as a missing header, response without a status code, or response without content). Now that you have checked your code you should try and set debug: true in your codecrafters.yml file for more verbose logs that can help you distinguish the problem a little better. Finally, please check your server logic to be sure the format of your HTTP response is correct and matches the HTTP specification, namely the status line (HTTP version and status code).