efegokdemir commented on code in PR #672:
URL: https://github.com/apache/shenyu-dashboard/pull/672#discussion_r4111427864


##########
src/routes/Document/components/ApiDebug.js:
##########
@@ -271,8 +272,7 @@ const FCForm = forwardRef(({ form, onSubmit }, ref) => {
               style={{ width: "40%" }}
               onChange={(envId) => {
                 const env = Object.values(envProps)[envId];
-                const url = new URL(env.addressUrl);
-                const host = `${url.protocol}//${url.hostname}:${url.port || 
"80"}`;
+                const host = buildEnvironmentHost(env.addressUrl);

Review Comment:
   Fixed in 0542494. Host construction and form validation were inconsistent: 
environment hosts now preserve omitted ports, but the validator still required 
host:port/path. Validation now parses the URL and accepts HTTP(S) URLs with 
omitted or explicit ports while rejecting non-HTTP(S) values. Added 
form/submission-level coverage for HTTP and HTTPS URLs with omitted and custom 
ports, plus a negative FTP case. ApiDebug focused tests, ESLint, Prettier, git 
diff --check, npm run lint, and npm run build passed.



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