)]}'
{"swift/common/middleware/gatekeeper.py":[{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"b9929864fc18de2767708313268e587e3c054f94","unresolved":false,"context_lines":[{"line_number":90,"context_line":"                       if h.lower() \u003d\u003d \u0027x-backend-gatekeeper-preserve-casing\u0027):"},{"line_number":91,"context_line":"                # By default, title-case headers"},{"line_number":92,"context_line":"                response_headers \u003d [(h.title(), v)"},{"line_number":93,"context_line":"                                    for h, v in response_headers]"},{"line_number":94,"context_line":"            removed \u003d filter("},{"line_number":95,"context_line":"                lambda h: self.outbound_condition(h[0]),"},{"line_number":96,"context_line":"                response_headers)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3aaa91ec_846508b0","line":93,"updated":"2016-07-01 10:20:18.000000000","message":"It ought to be possible to reduce to two iterations through the headers:\n\n- first iteration: search for \u0027x-backend-gatekeeper-preserve-casing\u0027 and apply the filtering condition\n- second iteration: (when required) perform the title()","commit_id":"2430bb28a47fbfb67d60176aac366c06aa48cdcb"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"eaa2420581da3d680b8307e2b07066f5763da14a","unresolved":false,"context_lines":[{"line_number":104,"context_line":"            # Enforce casing"},{"line_number":105,"context_line":"            kept \u003d [(h if h in preserved else h.title(), v) for h, v in kept]"},{"line_number":106,"context_line":""},{"line_number":107,"context_line":"            return start_response(status, kept, exc_info)"},{"line_number":108,"context_line":"        return self.app(env, gatekeeper_response)"},{"line_number":109,"context_line":""},{"line_number":110,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"1aa78d24_dba036a2","line":107,"updated":"2016-07-05 05:57:24.000000000","message":"In your commit message you give the example of \u0027header1, HEADER2\u0027 so your obviously checking and only matching on headers in the same case you have in preserved (oh and you do test this in the tests). In the situation where there was say a middleware behind (left of swift3) which decided to normalise or changed the etag header (witout relying on the gatekeeker). Then the preserved wouldn\u0027t match and therefore it\u0027ll just be title() as normal.\n\nI guess that\u0027s fine if that\u0027s the behaviour we want, thats an ok line in the sand for me.. though we could:\n\n  preserved \u003d dict([(h.lower(), h) for h in list_from_csv(value)])\n  ...\n\n  kept \u003d [(preserved[h] if h.lower() in preserved else h.title(), v) for h, v in kept]\n\nThat way the middleware in question (swift3 in my example) could actually specify the header case it needs as well. Or is this giving too much power to middleware\u0027s?","commit_id":"38d1b2880e09bfd9833eb41b9380d2201dc9c69f"}]}
