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

allow words to be in the template #169

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

Conversation

meme-lord
Copy link

This fixes #168
The check strings.Contains(template, word) has lots of unintended consequences.
Examples:
api-pizzapie.site.com would not be allowed as pizzapie contains api
site-api.site.com would not be allowed as site is in the template {{word}}-api.site.com
dev-api.site.dev would not be allowed as dev is in the template {{word}}-api.site.dev

I thought about adding a command option or adding a more complex check but decided just removing it is better.
I don't think the optimization saves much anyway, DNS requests are cheap.

Copy link
Member

@dwisiswant0 dwisiswant0 left a comment

Choose a reason for hiding this comment

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

Hey, thanks for the PR! It seems like this is more of a refactor than a bug fix since it would change the functionality.

payloadSet[v] = append(payloadSet[v], word)
}
}
payloadSet[v] = append([]string{}, m.Options.Payloads[v]...)
Copy link
Member

Choose a reason for hiding this comment

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

Instead of removing the !strings.Contains condition that's already in place, it would be better to enhance it by performing a comparison check where if the word is eq to sub, then just continue.

Also don't forget to add/update the test case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Expected output is missing
2 participants