)]}'
{"octavia/common/jinja/haproxy/templates/macros.j2":[{"author":{"_account_id":11628,"name":"Michael Johnson","email":"johnsomor@gmail.com","username":"johnsom"},"change_message_id":"8bce2dd8b0c69fe6e76a762200bf248d53597149","unresolved":false,"context_lines":[{"line_number":257,"context_line":"    http-request set-header X-Forwarded-Port %[dst_port]"},{"line_number":258,"context_line":"        {% endif %}"},{"line_number":259,"context_line":"        {% if listener.insert_headers.get(\u0027X-Forwarded-Proto\u0027,"},{"line_number":260,"context_line":"                                          \u0027False\u0027).lower() \u003d\u003d \u0027https\u0027 %}"},{"line_number":261,"context_line":"    reqadd X-Forwarded-Proto:\\ https"},{"line_number":262,"context_line":"        {% endif %}"},{"line_number":263,"context_line":"        {% if listener.insert_headers.get(\u0027X-Forwarded-Proto\u0027,"}],"source_content_type":"text/x-jinja2","patch_set":3,"id":"5f7c97a3_008527cf","line":260,"updated":"2018-06-07 17:13:03.000000000","message":"Shouldn\u0027t this test be based on the type of listener used for the request?\nFor example, if the listener is HTTP it would set \"http\", if the listener is \"TERMINATED_TLS\" it would set \"https\".","commit_id":"69730e0ef4b7b98161be135b9c02b462cc3681f8"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"8b9c6f2e35b5f855da71b0b5bbacab1fd8de3c3a","unresolved":false,"context_lines":[{"line_number":257,"context_line":"    http-request set-header X-Forwarded-Port %[dst_port]"},{"line_number":258,"context_line":"        {% endif %}"},{"line_number":259,"context_line":"    {% endif %}"},{"line_number":260,"context_line":"    {% if (listener.protocol.lower() \u003d\u003d constants.PROTOCOL_HTTP.lower()) %}"},{"line_number":261,"context_line":"        {% if listener.insert_headers.get(\u0027X-Forwarded-Proto\u0027,"},{"line_number":262,"context_line":"                                          \u0027False\u0027).lower() \u003d\u003d \u0027true\u0027 %}"},{"line_number":263,"context_line":"    reqadd X-Forwarded-Proto:\\ http"}],"source_content_type":"text/x-jinja2","patch_set":6,"id":"5f7c97a3_098299a6","line":260,"updated":"2018-06-14 19:11:03.000000000","message":"nit: the wrapping parens are unnecessary","commit_id":"2e1b9c8b46daf7a580ff57fd7aa5a04bada914f0"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"8b9c6f2e35b5f855da71b0b5bbacab1fd8de3c3a","unresolved":false,"context_lines":[{"line_number":263,"context_line":"    reqadd X-Forwarded-Proto:\\ http"},{"line_number":264,"context_line":"        {% endif %}"},{"line_number":265,"context_line":"    {% endif %}"},{"line_number":266,"context_line":"    {% if (listener.protocol.lower() \u003d\u003d"},{"line_number":267,"context_line":"       constants.PROTOCOL_TERMINATED_HTTPS.lower()) %}"},{"line_number":268,"context_line":"        {% if listener.insert_headers.get(\u0027X-Forwarded-Proto\u0027,"},{"line_number":269,"context_line":"                                          \u0027False\u0027).lower() \u003d\u003d \u0027true\u0027 %}"}],"source_content_type":"text/x-jinja2","patch_set":6,"id":"5f7c97a3_09ab791e","line":266,"updated":"2018-06-14 19:11:03.000000000","message":"nit: this should probably be an elif?","commit_id":"2e1b9c8b46daf7a580ff57fd7aa5a04bada914f0"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"8b9c6f2e35b5f855da71b0b5bbacab1fd8de3c3a","unresolved":false,"context_lines":[{"line_number":265,"context_line":"    {% endif %}"},{"line_number":266,"context_line":"    {% if (listener.protocol.lower() \u003d\u003d"},{"line_number":267,"context_line":"       constants.PROTOCOL_TERMINATED_HTTPS.lower()) %}"},{"line_number":268,"context_line":"        {% if listener.insert_headers.get(\u0027X-Forwarded-Proto\u0027,"},{"line_number":269,"context_line":"                                          \u0027False\u0027).lower() \u003d\u003d \u0027true\u0027 %}"},{"line_number":270,"context_line":"    reqadd X-Forwarded-Proto:\\ https"},{"line_number":271,"context_line":"        {% endif %}"}],"source_content_type":"text/x-jinja2","patch_set":6,"id":"5f7c97a3_496e5101","line":268,"updated":"2018-06-14 19:11:03.000000000","message":"Actually, if THIS was the outer check, it would probably be a little more clear, since really this is the main check. I would do this whole block like:\n\nif xforwardedproto \u003d\u003d true:\n  if protocol \u003d\u003d http:\n    regadd http\n  elif protocol \u003d\u003d https:\n    regadd https","commit_id":"2e1b9c8b46daf7a580ff57fd7aa5a04bada914f0"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"253fc6c36b87401ec855a76eb8b5e000a0cb7eac","unresolved":false,"context_lines":[{"line_number":260,"context_line":"    {% if listener.insert_headers.get(\u0027X-Forwarded-Proto\u0027,"},{"line_number":261,"context_line":"                                          \u0027False\u0027).lower() \u003d\u003d \u0027true\u0027 %}"},{"line_number":262,"context_line":"        {% if listener.protocol.lower() \u003d\u003d constants.PROTOCOL_HTTP.lower() %}"},{"line_number":263,"context_line":"    reqadd X-Forwarded-Proto:\\ http"},{"line_number":264,"context_line":"        {% elif listener.protocol.lower() \u003d\u003d"},{"line_number":265,"context_line":"                               constants.PROTOCOL_TERMINATED_HTTPS.lower() %}"},{"line_number":266,"context_line":"    reqadd X-Forwarded-Proto:\\ https"}],"source_content_type":"text/x-jinja2","patch_set":7,"id":"5f7c97a3_710bddd4","line":263,"updated":"2018-06-15 19:02:33.000000000","message":"Sorry I didn\u0027t notice this before -- `reqadd` seems to just be a blind append, it is probably safer to use `http-request set-header` as above.","commit_id":"27b326dad4610cb1a326cd0f7e76aecdfe730cd7"},{"author":{"_account_id":11628,"name":"Michael Johnson","email":"johnsomor@gmail.com","username":"johnsom"},"change_message_id":"ca6ee7919e5e10ea1642481f603af71c3ce133c3","unresolved":false,"context_lines":[{"line_number":260,"context_line":"    {% if listener.insert_headers.get(\u0027X-Forwarded-Proto\u0027,"},{"line_number":261,"context_line":"                                          \u0027False\u0027).lower() \u003d\u003d \u0027true\u0027 %}"},{"line_number":262,"context_line":"        {% if listener.protocol.lower() \u003d\u003d constants.PROTOCOL_HTTP.lower() %}"},{"line_number":263,"context_line":"    reqadd X-Forwarded-Proto:\\ http"},{"line_number":264,"context_line":"        {% elif listener.protocol.lower() \u003d\u003d"},{"line_number":265,"context_line":"                               constants.PROTOCOL_TERMINATED_HTTPS.lower() %}"},{"line_number":266,"context_line":"    reqadd X-Forwarded-Proto:\\ https"}],"source_content_type":"text/x-jinja2","patch_set":7,"id":"5f7c97a3_71d99d54","line":263,"in_reply_to":"5f7c97a3_710bddd4","updated":"2018-06-15 19:09:09.000000000","message":"Good catch. reqadd just adds the header. But http-request set-header will overwrite an existing header if one was presented to the proxy. \"http-request set-header\" makes sure users can\u0027t spoof the header setting.","commit_id":"27b326dad4610cb1a326cd0f7e76aecdfe730cd7"},{"author":{"_account_id":10273,"name":"Adam Harwell","email":"flux.adam@gmail.com","username":"rm_you"},"change_message_id":"253fc6c36b87401ec855a76eb8b5e000a0cb7eac","unresolved":false,"context_lines":[{"line_number":263,"context_line":"    reqadd X-Forwarded-Proto:\\ http"},{"line_number":264,"context_line":"        {% elif listener.protocol.lower() \u003d\u003d"},{"line_number":265,"context_line":"                               constants.PROTOCOL_TERMINATED_HTTPS.lower() %}"},{"line_number":266,"context_line":"    reqadd X-Forwarded-Proto:\\ https"},{"line_number":267,"context_line":"        {% endif %}"},{"line_number":268,"context_line":"    {% endif %}"},{"line_number":269,"context_line":"    {% if listener.connection_limit is defined %}"}],"source_content_type":"text/x-jinja2","patch_set":7,"id":"5f7c97a3_9110f902","line":266,"updated":"2018-06-15 19:02:33.000000000","message":"same","commit_id":"27b326dad4610cb1a326cd0f7e76aecdfe730cd7"}]}
