Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed target parsing #1137

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Fixed target parsing #1137

wants to merge 1 commit into from

Conversation

Astrarog
Copy link

Improved http(s) scheme check so that target may be passed in lower and upper cases.

Before the fix works only schemes:

  • http://
  • https://

After the fix also works schemes alike:

  • HTTPS://
  • HtTp://

Improved http(s) scheme check so that target may be passed in lower and upper cases.

Signed-off-by: Roman Astrakhantsev <[email protected]>
@@ -309,7 +309,8 @@ func ProbeHTTP(ctx context.Context, target string, module config.Module, registr

httpConfig := module.HTTP

if !strings.HasPrefix(target, "http://") && !strings.HasPrefix(target, "https://") {
targetLower := strings.ToLower(target)
if !strings.HasPrefix(targetLower, "http://") && !strings.HasPrefix(targetLower, "https://") {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the PR, can you please add a test so don't break this accidently in the future :)

@github-actions github-actions bot added the stale label Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants