Try using route.request
def handle_request(route):
headers = route.request.headers
if "match_string" in route.request.url:
headers['custom_header_1'] = 'value_!23'
route.continue_(headers=headers)
See also this sample from the official documentation: