Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(tunnel): check dest URL protocol
Previously, the NewTunnel function assumed that the destination URL always starts with "http://" and added it if not present. This commit refactors the logic to properly check for the scheme and add "http://" if the scheme is missing or invalid. The changes include: * Checking for "http://" or "https://" prefixes in the destination URL. * If the prefix is missing or invalid, "http://" is appended to the destination URL. * This ensures that the ReverseProxy uses a valid destination URL for forwarding requests. This fix addresses potential issues when the destination URL is provided without a proper scheme, leading to incorrect behavior of the tunnel. Signed-off-by: Dwi Siswanto <[email protected]>
- Loading branch information