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

Introducing CanHaveTitleTag Function for MIME Type Validation #1608

Merged
merged 14 commits into from
Mar 23, 2024
Merged

Introducing CanHaveTitleTag Function for MIME Type Validation #1608

merged 14 commits into from
Mar 23, 2024

Conversation

RedYetiDev
Copy link
Contributor

This pull request introduces a new function called CanHaveTitleTag. The purpose of this function is to validate whether a given MIME type supports the extraction of a <title> tag from its content. The motivation behind this addition is to address issues where the extractor incorrectly assumes support for a <title> tag, even when it's not applicable, such as in application/json MIME types.

Changes:

  1. Added a new function CanHaveTitleTag in title.go to perform validation for MIME types supporting <title> tag extraction.
  2. Updated runner.go to use the new function

Note

I'm not a frequent go developer, and this may be an ineffective way to achieve this goal, but from what I can tell, it gets the job done.

dependabot bot and others added 8 commits December 21, 2023 12:59
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.14.0 to 0.17.0.
- [Commits](golang/crypto@v0.14.0...v0.17.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
)

Bumps [github.com/cloudflare/circl](https://github.com/cloudflare/circl) from 1.3.3 to 1.3.7.
- [Release notes](https://github.com/cloudflare/circl/releases)
- [Commits](cloudflare/circl@v1.3.3...v1.3.7)

---
updated-dependencies:
- dependency-name: github.com/cloudflare/circl
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…1531)

Bumps [github.com/quic-go/quic-go](https://github.com/quic-go/quic-go) from 0.37.4 to 0.37.7.
- [Release notes](https://github.com/quic-go/quic-go/releases)
- [Changelog](https://github.com/quic-go/quic-go/blob/master/Changelog.md)
- [Commits](quic-go/quic-go@v0.37.4...v0.37.7)

---
updated-dependencies:
- dependency-name: github.com/quic-go/quic-go
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
@ehsandeep ehsandeep changed the base branch from main to dev March 6, 2024 16:21
@RedYetiDev
Copy link
Contributor Author

Hi! I noticed that some of the builds were failing with use of untyped nil in assignment, does that have to do with title := nil? How do I fix that?

Copy link
Member

@dogancanbakir dogancanbakir left a comment

Choose a reason for hiding this comment

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

I left some comments for you; thanks for the PR!

common/httpx/title.go Outdated Show resolved Hide resolved
runner/runner.go Outdated Show resolved Hide resolved
common/httpx/title.go Show resolved Hide resolved
@RedYetiDev
Copy link
Contributor Author

RedYetiDev commented Mar 7, 2024

Once this is ready, I'll squash and open a new pull if you'd like, or we can keep it here.

@RedYetiDev
Copy link
Contributor Author

Thanks for the approval, would you like me to squash, or leave it?

@RedYetiDev
Copy link
Contributor Author

The latest commit shouldn't cause any issues, I updated the patch to match the code on the dev branch rather than the main branch.

@RedYetiDev
Copy link
Contributor Author

Hi, seeing as there are 11 commits for this, I feel like squashing might be wise, is that done during the merge process, or should I do it and re-open a pull?

@RedYetiDev
Copy link
Contributor Author

Hi, any update on this?

@ehsandeep ehsandeep merged commit c72d986 into projectdiscovery:dev Mar 23, 2024
11 checks passed
@RedYetiDev
Copy link
Contributor Author

Thanks!

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.

4 participants