mirror of
https://github.com/fosrl/pangolin.git
synced 2026-02-15 01:16:38 +00:00
update parser to handle h2c
This commit is contained in:
@@ -650,8 +650,8 @@ export default function ReverseProxyTargets(props: {
|
||||
className="min-w-[150px]"
|
||||
onBlur={(e) => {
|
||||
const input = e.target.value.trim();
|
||||
const hasProtocol = /^https?:\/\//.test(input);
|
||||
const hasPort = /:\d+/.test(input);
|
||||
const hasProtocol = /^(https?|h2c):\/\//.test(input);
|
||||
const hasPort = /:\d+(?:\/|$)/.test(input);
|
||||
|
||||
if (hasProtocol || hasPort) {
|
||||
const parsed = parseHostTarget(input);
|
||||
@@ -675,9 +675,7 @@ export default function ReverseProxyTargets(props: {
|
||||
});
|
||||
}
|
||||
}}
|
||||
|
||||
/>
|
||||
|
||||
)
|
||||
},
|
||||
{
|
||||
@@ -973,8 +971,8 @@ export default function ReverseProxyTargets(props: {
|
||||
{...field}
|
||||
onBlur={(e) => {
|
||||
const input = e.target.value.trim();
|
||||
const hasProtocol = /^https?:\/\//.test(input);
|
||||
const hasPort = /:\d+/.test(input);
|
||||
const hasProtocol = /^(https?|h2c):\/\//.test(input);
|
||||
const hasPort = /:\d+(?:\/|$)/.test(input);
|
||||
|
||||
if (hasProtocol || hasPort) {
|
||||
const parsed = parseHostTarget(input);
|
||||
|
||||
Reference in New Issue
Block a user