cloudbase-ai opened a new pull request, #7895:
URL: https://github.com/apache/shenyu/pull/7895

   Fixes #7894.
   
   An upstream configured as `https://` with address `example.com:8443` 
previously caused automatic Swagger loading to request 
`http://example.com:8443/project/v3/api-docs`. Preserve the transport scheme 
from discovery through the internal UpstreamInstance and document request, and 
use port 443 when HTTPS has no explicit port. Both startup scans and discovery 
callbacks use URI parsing instead of colon splitting. Existing callers retain 
HTTP by default.
   
   Include the scheme in instance equality/hashCode and generated API document 
metadata. Manual Swagger import also sets the scheme on its virtual instance so 
imported HTTPS documents retain consistent metadata. This does not change its 
fetch or URL policy.
   
   Validation on Java 17 with the Maven wrapper:
   
   - Before the fix, 8 of 14 request-path regression cases failed: both public 
loader entry points downgraded HTTPS and failed bracketed IPv6 parsing. The 
HTTP/default-protocol controls passed.
   - After the fix, all 33 focused tests pass. Coverage includes default HTTP, 
HTTPS with implicit/explicit ports, scheme values with/without `://`, bracketed 
IPv6, document metadata, virtual import instances, equality and existing 
refresh/lock behavior. Request-path tests run real loader, pull service and 
HttpUtils code with an OkHttp application interceptor; they do not contact 
external hosts.
   - A separate local HttpsServer smoke test fetched and consumed the document 
through both startup scan and discovery UPDATE using the production HTTP 
client. The temporary localhost certificate was explicitly trusted in that test 
JVM; standard certificate and hostname verification remained enabled. No TLS 
policy was changed.
   - Admin and dependency reactor: 2,979 tests, 0 failures, 0 errors, 6 
skipped. Checkstyle, Apache RAT and git diff --check pass.
   
   ```sh
   ./mvnw -B -ntp -pl shenyu-admin -am test apache-rat:check \
     -DskipRemoteResources=true -Djacoco.skip=true -Dmaven.javadoc.skip=true
   ```
   
   PR #6456 also touches address parsing in LoadServiceDocEntryImpl as part of 
general IPv6 support; its changes will need reconciliation with the 
document-loader URI parsing here. This fix is separate from the manual-import 
DNS/port policy in #7868 and does not claim to reproduce #6362. Docker gateway 
E2E and live external HTTPS backends were not exercised for this Admin 
document-loading change.
   
   - [x] Follow the contribution guidelines and DCO sign-off.
   - [x] Add regression coverage and run the affected reactor checks described 
above.
   - [ ] Full-repository clean install (validation here is the Admin dependency 
reactor).
   


-- 
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]

Reply via email to