Welcome to your multi-fault debugging challenge! In this task, your objective is to identify and fix two bugs within the same file. The buggy code is located in /app/solution.py. You must resolve all bugs for the task to be considered complete.
Bug 1 (ID: 3):
The first issue arises in the handling of request headers. Currently, if a specific header value is explicitly set to None, it is not adequately ignored. This results in undesired behavior where certain headers are processed incorrectly, potentially leading to issues further along in the request lifecycle. Your goal is to ensure that these headers are appropriately managed.
Bug 2 (ID: 4):
The second problem exists within the construction of HTTP headers. The code incorrectly checks the existence of the 'Host' header. Instead of verifying against a copied version of headers, it should be checking the original headers from which it was derived. This oversight may cause the 'Host' header to be improperly set, affecting the correctness of the HTTP request.
Requirements:
You must locate and correct both bugs in the provided file.
All fixes will be automatically verified through tests that will be executed via from solution import *.
Important:
Make sure to address both bugs in order to successfully complete this challenge. Good luck, and happy debugging!