[C++] Return a File section

Tests are failing, but if I manually test examples - everything works fine.
Test logs:
remote: [tester::#AP6] Failed to read response:
remote: [tester::#AP6] Received: “” (no content received)
remote: [tester::#AP6] ^ error
remote: [tester::#AP6] Error: Expected: HTTP-version, Received: “”
remote: [tester::#AP6] Test failed (try setting ‘debug: true’ in your codecrafters.yml to see more details)

Code published in my repo (master branch)

I’ll take a look and get back to you shortly.

image
Response is valid, but tests still failing.

Hey @rabbit-821, it’s not safe to assume the exact order or the presence of certain header fields:

If some assumed headers are missing, it can lead to issues :

To handle headers dynamically, consider using unordered_map. (Keep in mind that HTTP headers are case-insensitive, so you may need to convert keys to lowercase before insertion to ensure reliable lookups.)

Let me know if you’d like further clarification!

Thank you! Looks like I need to parse headers to map.

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.