SolidWallOfCode commented on code in PR #9618:
URL: https://github.com/apache/trafficserver/pull/9618#discussion_r1175722290
##########
tests/gold_tests/tls/tls_tunnel.test.py:
##########
@@ -96,19 +96,19 @@
"- fqdn: bob.*.com",
" tunnel_route: localhost:{0}".format(server_foo.Variables.SSL_Port),
"- fqdn: '*.match.com'",
- " tunnel_route: $1.testmatch:{0}".format(server_foo.Variables.SSL_Port),
+ ''' tunnel_route:
"{{1}}.testmatch:{0}"'''.format(server_foo.Variables.SSL_Port),
"- fqdn: '*.ok.*.com'",
- " tunnel_route: $2.example.$1:{0}".format(server_foo.Variables.SSL_Port),
+ ''' tunnel_route:
"{{2}}.example.{{1}}:{0}"'''.format(server_foo.Variables.SSL_Port),
"- fqdn: ''", # No SNI sent
" tunnel_route: localhost:{0}".format(server_bar.Variables.SSL_Port),
"- fqdn: 'incoming.port.com'",
- " tunnel_route: backend.incoming.port.com:{inbound_local_port}",
+ ''' tunnel_route: "backend.incoming.port.com:{inbound_local_port}"''',
"- fqdn: 'proxy.protocol.port.com'",
- " tunnel_route: backend.proxy.protocol.port.com:{proxy_protocol_port}",
+ ''' tunnel_route:
"backend.proxy.protocol.port.com:{proxy_protocol_port}"''',
"- fqdn: '*.*.incoming.port.com'",
- " tunnel_route: backend.$1.$2.incoming.port.com:{inbound_local_port}",
+ ''' tunnel_route:
"backend.{1}.{2}.incoming.port.com:{inbound_local_port}"''',
Review Comment:
For the first point, the braces are removed by the substitution, just as is
done currently. It would be expected that a correctly formatted string would
not have any braces in the final result.
For the error cases, I pondered that. What happens current if "$3" is
present but there are insufficient match groups? I would need to make a tweak
to libswoc to provide access to the parsed format, after which the logic could
check for invalid substitutions for names and match groups.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]