Closed tiantun closed 3 years ago
@ataquedosesquilos Thank you once again for your feedback and suggested improvement! I've opened this PR so that we can keep the discussion going in the open directly with the developers on this repo.
Do you, by any chance, have an implementation of the suggested the '2xx' validation? If so, please feel free to add it to your branch. AFAIK the pull request should automatically be updated with them
Hi Tiago,
i would propose:
if (size > 0) { byte[] responseBytes = new byte[buffer.remaining()]; buffer.get(responseBytes); response = new String(responseBytes, StandardCharsets.UTF_8); final Scanner responseScanner = new Scanner(response); if (responseScanner.hasNextLine()) { final String firstLine = responseScanner.nextLine(); if ((firstLine.toLowerCase().contains("http/1.1") || firstLine.toLowerCase().contains("http/1.0")) && firstLine.matches("(.)2[0-9][0-9](.)")) { return new ProxyResponseResult(true, null); } } }
the regex is being changed, i'll update my fork i have just tested it and worked, but feel free to share a branch i can checkout and run a build if the team needs me to test.
@ataquedosesquilos Hey. The test comment has yet to be resolved. https://github.com/Azure/qpid-proton-j-extensions/pull/36/files#r625235374
@conniey is all good to accept this pr or still want to review something else?
Hi team,
I'm opening this PR for a customer suggested improvement to the current proxy implementation. Issue: The current implementation only accepts "200 Connected" responses from the proxy. Some proxies seem to be replying with slightly different responses, such as "200 Connection established" rather than "200 Connected", which we are expecting.
Fix: The change implemented in this fork would allow "connection established" as a valid response.
Suggestion: As further suggested and discussed via email, the likely sufficient and right validation would be to accept response '2xx' response codes.