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

Upstream revision 344c54a #31

Merged
merged 142 commits into from
Apr 12, 2023
Merged
Show file tree
Hide file tree
Changes from 140 commits
Commits
Show all changes
142 commits
Select commit Hold shift + click to select a range
157d0e5
Merge pull request #835 from projectdiscovery/dev
ehsandeep Oct 29, 2022
42fd260
Merge branch 'dev' of https://github.com/projectdiscovery/httpx
ehsandeep Oct 29, 2022
525aeb0
Merge pull request #928 from projectdiscovery/dev
ehsandeep Jan 6, 2023
8a084de
chore(deps): bump github.com/projectdiscovery/wappalyzergo
dependabot[bot] Jan 9, 2023
330a730
chore(deps): bump github.com/projectdiscovery/fastdialer
dependabot[bot] Jan 9, 2023
a6c0255
Merge pull request #931 from projectdiscovery/dependabot/go_modules/d…
ehsandeep Jan 9, 2023
266dad2
Merge pull request #930 from projectdiscovery/dependabot/go_modules/d…
ehsandeep Jan 9, 2023
a09b007
chore(deps): bump golang from 1.19.4-alpine to 1.19.5-alpine
dependabot[bot] Jan 16, 2023
f9e6c48
chore(deps): bump alpine from 3.17.0 to 3.17.1
dependabot[bot] Jan 16, 2023
4e7504a
chore(deps): bump github.com/projectdiscovery/wappalyzergo
dependabot[bot] Jan 16, 2023
0e91cd4
chore(deps): bump github.com/projectdiscovery/hmap from 0.0.6 to 0.0.7
dependabot[bot] Jan 16, 2023
33e2558
chore(deps): bump github.com/projectdiscovery/clistats
dependabot[bot] Jan 16, 2023
cbed0f4
Merge pull request #944 from projectdiscovery/dependabot/go_modules/d…
ehsandeep Jan 16, 2023
9f2a9b9
Merge pull request #942 from projectdiscovery/dependabot/go_modules/d…
ehsandeep Jan 16, 2023
bf1d93f
Merge pull request #941 from projectdiscovery/dependabot/go_modules/d…
ehsandeep Jan 16, 2023
e40a31e
Merge pull request #939 from projectdiscovery/dependabot/docker/dev/a…
ehsandeep Jan 16, 2023
974f578
Merge pull request #938 from projectdiscovery/dependabot/docker/dev/g…
ehsandeep Jan 16, 2023
50e94ad
chore(deps): bump github.com/projectdiscovery/ratelimit
dependabot[bot] Jan 23, 2023
6993587
Merge pull request #948 from projectdiscovery/dependabot/go_modules/d…
ehsandeep Jan 23, 2023
0c81824
chore(deps): bump github.com/projectdiscovery/fastdialer
dependabot[bot] Jan 23, 2023
002fa3a
chore(deps): bump golangci/golangci-lint-action from 3.3.1 to 3.4.0
dependabot[bot] Jan 30, 2023
2a0105e
chore(deps): bump github.com/projectdiscovery/wappalyzergo
dependabot[bot] Jan 30, 2023
3a180b5
chore(deps): bump github.com/microcosm-cc/bluemonday
dependabot[bot] Jan 30, 2023
f5eb42d
Merge pull request #954 from projectdiscovery/dependabot/go_modules/d…
Mzack9999 Jan 31, 2023
93e373a
Merge pull request #952 from projectdiscovery/dependabot/go_modules/d…
Mzack9999 Jan 31, 2023
a64a807
Merge pull request #951 from projectdiscovery/dependabot/github_actio…
Mzack9999 Jan 31, 2023
4967403
Merge pull request #947 from projectdiscovery/dependabot/go_modules/d…
Mzack9999 Jan 31, 2023
845a239
chore(deps): bump docker/build-push-action from 3 to 4
dependabot[bot] Feb 6, 2023
e9f6025
chore(deps): bump golang from 1.19.5-alpine to 1.20.0-alpine
dependabot[bot] Feb 6, 2023
b0e22b7
chore(deps): bump github.com/projectdiscovery/wappalyzergo
dependabot[bot] Feb 6, 2023
fbadeec
chore(deps): bump github.com/projectdiscovery/clistats
dependabot[bot] Feb 6, 2023
3a93d2d
bump url utils to v0.0.7
tarunKoyalwar Feb 7, 2023
c745692
fix integration tests and upgrade deps
tarunKoyalwar Feb 8, 2023
c4fb1cc
fix path error in favicon
tarunKoyalwar Feb 8, 2023
0233de1
Merge pull request #961 from projectdiscovery/dependabot/github_actio…
ehsandeep Feb 8, 2023
87ef793
Merge pull request #962 from projectdiscovery/dependabot/docker/dev/g…
ehsandeep Feb 8, 2023
2d04540
Merge pull request #963 from projectdiscovery/dependabot/go_modules/d…
ehsandeep Feb 8, 2023
3c3dfd3
Merge pull request #964 from projectdiscovery/dependabot/go_modules/d…
ehsandeep Feb 8, 2023
65c3e01
resolve merge conflicts
tarunKoyalwar Feb 8, 2023
51eb87a
Merge pull request #966 from projectdiscovery/issue-958-urlutils
Mzack9999 Feb 8, 2023
28ac75c
chore(deps): bump github.com/projectdiscovery/tlsx from 1.0.3 to 1.0.…
dependabot[bot] Feb 9, 2023
afa1ae3
chore(deps): bump github.com/projectdiscovery/ratelimit from 0.0.5 to…
dependabot[bot] Feb 9, 2023
11ac2e5
chore(deps): bump github.com/projectdiscovery/tlsx from 1.0.4 to 1.0.…
dependabot[bot] Feb 9, 2023
2d69acd
chore(deps): bump golang.org/x/net from 0.5.0 to 0.6.0 (#969)
dependabot[bot] Feb 9, 2023
7f5acf7
chore(deps): bump golang.org/x/text from 0.6.0 to 0.7.0 (#970)
dependabot[bot] Feb 9, 2023
b89ea6c
version update
ehsandeep Feb 9, 2023
1752c2d
Merge branch 'main' into dev
ehsandeep Feb 9, 2023
954cbe6
Merge pull request #973 from projectdiscovery/dev
ehsandeep Feb 9, 2023
ad4b5d9
chore(deps): bump github.com/projectdiscovery/tlsx from 1.0.4 to 1.0.5
dependabot[bot] Feb 10, 2023
a1363cd
Merge pull request #976 from projectdiscovery/dependabot/go_modules/d…
Mzack9999 Feb 13, 2023
45da5da
chore(deps): bump alpine from 3.17.1 to 3.17.2
dependabot[bot] Feb 13, 2023
f77f161
chore(deps): bump github.com/projectdiscovery/wappalyzergo
dependabot[bot] Feb 13, 2023
974457f
chore(deps): bump github.com/projectdiscovery/fastdialer
dependabot[bot] Feb 13, 2023
6dfaed5
chore(deps): bump github.com/projectdiscovery/tlsx from 1.0.4 to 1.0.5
dependabot[bot] Feb 13, 2023
85bfb2e
Merge pull request #981 from projectdiscovery/dependabot/go_modules/d…
Mzack9999 Feb 14, 2023
49c8939
Merge pull request #980 from projectdiscovery/dependabot/go_modules/d…
Mzack9999 Feb 14, 2023
8b4c0a6
Merge pull request #978 from projectdiscovery/dependabot/docker/dev/a…
Mzack9999 Feb 14, 2023
f47e77a
Merge pull request #979 from projectdiscovery/dependabot/go_modules/d…
Mzack9999 Feb 14, 2023
576863f
bumping asnmap + mapcidr
Mzack9999 Feb 14, 2023
0d4874f
attempt to fix hash
Mzack9999 Feb 14, 2023
345e006
Merge pull request #983 from projectdiscovery/maint-asnmap
Mzack9999 Feb 14, 2023
f824fe6
chore(deps): bump golang.org/x/net from 0.6.0 to 0.7.0
dependabot[bot] Feb 15, 2023
9ef14af
chore(deps): bump github.com/projectdiscovery/tlsx from 1.0.4 to 1.0.5
dependabot[bot] Feb 15, 2023
bf7dff1
chore(deps): bump github.com/projectdiscovery/hmap from 0.0.7 to 0.0.8
dependabot[bot] Feb 15, 2023
c506f49
Merge pull request #984 from projectdiscovery/dependabot/go_modules/d…
ehsandeep Feb 20, 2023
14d001b
Merge pull request #985 from projectdiscovery/dependabot/go_modules/d…
ehsandeep Feb 20, 2023
752cb05
Merge pull request #986 from projectdiscovery/dependabot/go_modules/d…
ehsandeep Feb 20, 2023
094dc50
chore(deps): bump github.com/projectdiscovery/gologger
dependabot[bot] Feb 20, 2023
4d82759
Merge pull request #987 from projectdiscovery/dependabot/go_modules/d…
ehsandeep Feb 20, 2023
5697aeb
chore(deps): bump golang from 1.20.0-alpine to 1.20.1-alpine
dependabot[bot] Feb 20, 2023
791e352
chore(deps): bump github.com/projectdiscovery/goflags
dependabot[bot] Feb 20, 2023
87c1320
chore(deps): bump github.com/projectdiscovery/fastdialer
dependabot[bot] Feb 20, 2023
e5314cd
chore(deps): bump github.com/projectdiscovery/wappalyzergo
dependabot[bot] Feb 20, 2023
fa2410b
chore(deps): bump github.com/PuerkitoBio/goquery from 1.8.0 to 1.8.1
dependabot[bot] Feb 20, 2023
f0d1621
chore(deps): bump github.com/projectdiscovery/tlsx from 1.0.4 to 1.0.5
dependabot[bot] Feb 20, 2023
51c4375
clarify README -ms flag to be case insensitive
minispooner Feb 24, 2023
eaa9dc7
Merge pull request #990 from projectdiscovery/dependabot/docker/dev/g…
ehsandeep Feb 25, 2023
3b69e2c
Merge pull request #991 from projectdiscovery/dependabot/go_modules/d…
ehsandeep Feb 25, 2023
c71697a
Merge pull request #992 from projectdiscovery/dependabot/go_modules/d…
ehsandeep Feb 25, 2023
dcf3299
Merge pull request #993 from projectdiscovery/dependabot/go_modules/d…
ehsandeep Feb 25, 2023
50a5637
Merge pull request #994 from projectdiscovery/dependabot/go_modules/d…
ehsandeep Feb 25, 2023
9bb7efa
Merge pull request #995 from projectdiscovery/dependabot/go_modules/d…
ehsandeep Feb 25, 2023
f87c4d7
docker workflow fix (#1003)
ehsandeep Feb 26, 2023
78bf4e0
chore(deps): bump github.com/projectdiscovery/goconfig
dependabot[bot] Feb 27, 2023
7ddc8d6
chore(deps): bump github.com/projectdiscovery/utils
dependabot[bot] Feb 27, 2023
dbbbfd8
Merge pull request #1008 from projectdiscovery/dependabot/go_modules/…
Mzack9999 Feb 28, 2023
3d85c97
chore(deps): bump github.com/projectdiscovery/wappalyzergo
dependabot[bot] Feb 28, 2023
d4c97f7
Merge pull request #1005 from projectdiscovery/dependabot/go_modules/…
Mzack9999 Feb 28, 2023
d0d3d2a
rephrasing
Mzack9999 Feb 28, 2023
7ce4af1
chore(deps): bump github.com/projectdiscovery/retryablehttp-go
dependabot[bot] Feb 28, 2023
32900c2
chore(deps): bump golang.org/x/net from 0.6.0 to 0.7.0
dependabot[bot] Feb 28, 2023
fbae1ab
Fixing asn with ip:port
Mzack9999 Feb 28, 2023
65660fa
Merge pull request #1010 from projectdiscovery/dependabot/go_modules/…
Mzack9999 Feb 28, 2023
9874d95
Merge pull request #1007 from projectdiscovery/dependabot/go_modules/…
Mzack9999 Feb 28, 2023
7688a2f
Merge pull request #1004 from projectdiscovery/dependabot/go_modules/…
Mzack9999 Feb 28, 2023
2170dc0
Merge pull request #999 from minispooner/patch-1
Mzack9999 Feb 28, 2023
cfebed8
chore(deps): bump github.com/projectdiscovery/rawhttp
dependabot[bot] Feb 28, 2023
9240d69
Merge pull request #1006 from projectdiscovery/dependabot/go_modules/…
Mzack9999 Feb 28, 2023
7a40876
chore(deps): bump github.com/projectdiscovery/tlsx from 1.0.4 to 1.0.5
dependabot[bot] Feb 28, 2023
bb040fd
chore(deps): bump github.com/stretchr/testify from 1.8.1 to 1.8.2
dependabot[bot] Feb 28, 2023
ddbf835
Merge pull request #1013 from projectdiscovery/dependabot/go_modules/…
Mzack9999 Feb 28, 2023
225e640
Merge pull request #1012 from projectdiscovery/dependabot/go_modules/…
Mzack9999 Feb 28, 2023
22ab49c
Merge pull request #1011 from projectdiscovery/issue-989-asn
Mzack9999 Mar 1, 2023
c6998f4
chore(deps): bump github.com/projectdiscovery/hmap from 0.0.7 to 0.0.…
iamleot Mar 5, 2023
8377358
chore(deps): bump github.com/projectdiscovery/tlsx from 1.0.4 to 1.0.…
dependabot[bot] Mar 5, 2023
dcd2994
chore(deps): bump github.com/projectdiscovery/asnmap from 1.0.0 to 1.…
dependabot[bot] Mar 5, 2023
43b4f5d
Improving split with URLs (#1009)
Mzack9999 Mar 5, 2023
ee7430b
Update HTTPX to v1.2.8 and update necessary files for compatibility.
ehsandeep Mar 5, 2023
6ba7510
Merge pull request #1020 from projectdiscovery/workflow-imp
ehsandeep Mar 5, 2023
2eaa6c1
chore(deps): bump github.com/projectdiscovery/hmap from 0.0.8 to 0.0.9
dependabot[bot] Mar 6, 2023
41c9fb1
chore(deps): bump github.com/projectdiscovery/wappalyzergo
dependabot[bot] Mar 6, 2023
47fe74c
chore(deps): bump github.com/projectdiscovery/goflags
dependabot[bot] Mar 6, 2023
1372d32
chore(deps): bump golang.org/x/net from 0.7.0 to 0.8.0
dependabot[bot] Mar 6, 2023
f0728a2
Merge pull request #1024 from projectdiscovery/dependabot/go_modules/…
ehsandeep Mar 6, 2023
6b5b90c
Merge pull request #1021 from projectdiscovery/dependabot/go_modules/…
ehsandeep Mar 7, 2023
134cbaa
Merge pull request #1022 from projectdiscovery/dependabot/go_modules/…
ehsandeep Mar 7, 2023
3963d2b
Merge pull request #1023 from projectdiscovery/dependabot/go_modules/…
ehsandeep Mar 7, 2023
cd91209
chore(deps): bump github.com/projectdiscovery/tlsx from 1.0.4 to 1.0.5
dependabot[bot] Mar 7, 2023
280928a
chore(deps): bump github.com/projectdiscovery/utils
dependabot[bot] Mar 7, 2023
4fa522b
chore(deps): bump github.com/microcosm-cc/bluemonday
dependabot[bot] Mar 8, 2023
3744e48
Merge pull request #1026 from projectdiscovery/dependabot/go_modules/…
ehsandeep Mar 12, 2023
9364fd4
Merge pull request #1027 from projectdiscovery/dependabot/go_modules/…
ehsandeep Mar 12, 2023
7825950
Merge pull request #1028 from projectdiscovery/dependabot/go_modules/…
ehsandeep Mar 12, 2023
28c5597
chore(deps): bump go.uber.org/multierr from 1.9.0 to 1.10.0
dependabot[bot] Mar 12, 2023
d84db54
Merge pull request #1029 from projectdiscovery/dependabot/go_modules/…
ehsandeep Mar 12, 2023
a9028e2
Merge branch 'main' into dev
ehsandeep Mar 12, 2023
a07f839
Merge pull request #1032 from projectdiscovery/dev
ehsandeep Mar 12, 2023
c67bf20
fix nil pointer dereference when probing ips of unresolved host (#1033)
freimer Mar 13, 2023
3c9a323
chore(deps): bump golang from 1.20.1-alpine to 1.20.2-alpine (#1035)
dependabot[bot] Mar 13, 2023
541de70
chore(deps): bump github.com/projectdiscovery/utils from 0.0.14 to 0.…
dependabot[bot] Mar 13, 2023
3a65156
chore(deps): bump github.com/projectdiscovery/hmap from 0.0.9 to 0.0.…
dependabot[bot] Mar 13, 2023
4255017
chore(deps): bump github.com/projectdiscovery/retryablehttp-go from 1…
dependabot[bot] Mar 13, 2023
73cfb29
chore(deps): bump github.com/projectdiscovery/rawhttp from 0.1.9 to 0…
dependabot[bot] Mar 14, 2023
0b96117
chore(deps): bump github.com/projectdiscovery/asnmap from 1.0.1 to 1.…
dependabot[bot] Mar 14, 2023
45721e8
chore(deps): bump github.com/projectdiscovery/wappalyzergo from 0.0.8…
dependabot[bot] Mar 14, 2023
948dd32
add update check and self update options (#1041)
RamanaReddy0M Mar 14, 2023
1263420
version update
ehsandeep Mar 14, 2023
6647924
go mod tidy
ehsandeep Mar 14, 2023
17f1395
Merge branch 'main' into dev
ehsandeep Mar 14, 2023
344c54a
Merge pull request #1046 from projectdiscovery/dev
ehsandeep Mar 14, 2023
eb5afaa
Merge branch 'main' into upstream-to-pr/rev-344c54a
fopina Apr 11, 2023
d09ec97
revert N-core runners from upstream
fopina Apr 11, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: 🔨 Build Test

on:
pull_request:
paths:
- '**.go'
- '**.mod'
workflow_dispatch:

jobs:
Expand All @@ -10,7 +13,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
os: [ubuntu-latest-16-cores, windows-latest-8-cores, macOS-latest]
steps:
- name: Set up Go
uses: actions/setup-go@v3
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ name: 🚨 CodeQL Analysis
on:
workflow_dispatch:
pull_request:
paths:
- '**.go'
branches:
- dev

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
runs-on: ubuntu-latest-16-cores
permissions:
actions: read
contents: read
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/dockerhub-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ on:

jobs:
docker:
runs-on: ubuntu-latest
runs-on: ubuntu-latest-16-cores
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Get Github tag
id: meta
run: |
echo "::set-output name=tag::$(curl --silent "https://api.github.com/repos/projectdiscovery/httpx/releases/latest" | jq -r .tag_name)"
curl --silent "https://api.github.com/repos/projectdiscovery/httpx/releases/latest" | jq -r .tag_name | xargs -I {} echo TAG={} >> $GITHUB_OUTPUT

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
Expand All @@ -32,9 +32,9 @@ jobs:
password: ${{ secrets.DOCKER_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v3
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64,linux/arm64,linux/arm
push: true
tags: projectdiscovery/httpx:latest,projectdiscovery/httpx:${{ steps.meta.outputs.tag }}
tags: projectdiscovery/httpx:latest,projectdiscovery/httpx:${{ steps.meta.outputs.TAG }}
5 changes: 4 additions & 1 deletion .github/workflows/functional-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: 🧪 Functional Test

on:
pull_request:
paths:
- '**.go'
- '**.mod'
workflow_dispatch:

jobs:
Expand All @@ -10,7 +13,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
os: [ubuntu-latest-16-cores, windows-latest-8-cores, macOS-latest]
steps:
- name: Set up Go
uses: actions/setup-go@v3
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/lint-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@ name: 🙏🏻 Lint Test

on:
pull_request:
paths:
- '**.go'
- '**.mod'
workflow_dispatch:

jobs:
lint:
name: Lint Test
runs-on: ubuntu-latest
runs-on: ubuntu-latest-16-cores
steps:
- name: Set up Go
uses: actions/setup-go@v3
Expand All @@ -16,7 +19,7 @@ jobs:
- name: Checkout code
uses: actions/checkout@v3
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v3.3.1
uses: golangci/golangci-lint-action@v3.4.0
with:
version: latest
args: --timeout 5m
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-binary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

jobs:
release:
runs-on: ubuntu-latest
runs-on: ubuntu-latest-16-cores
steps:
- name: "Check out code"
uses: actions/checkout@v3
Expand Down
34 changes: 0 additions & 34 deletions .github/workflows/sonarcloud.yml

This file was deleted.

16 changes: 10 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
FROM golang:1.19.4-alpine AS builder
ARG BUILD_SOURCE_TAG=latest
# Base
FROM golang:1.20.2-alpine AS builder

RUN apk add --no-cache git build-base gcc musl-dev
RUN go install -v github.com/projectdiscovery/httpx/cmd/httpx@${BUILD_SOURCE_TAG}
WORKDIR /app
COPY . /app
RUN go mod download
RUN go build ./cmd/httpx

FROM alpine:3.17.0
FROM alpine:3.17.2
RUN apk -U upgrade --no-cache \
&& apk add --no-cache bind-tools ca-certificates
COPY --from=builder /go/bin/httpx /usr/local/bin/
COPY --from=builder /app/httpx /usr/local/bin/

ENTRYPOINT ["httpx"]
ENTRYPOINT ["httpx"]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ MATCHERS:
-mlc, -match-line-count string match response body with specified line count (-mlc 423,532)
-mwc, -match-word-count string match response body with specified word count (-mwc 43,55)
-mfc, -match-favicon string[] match response with specified favicon hash (-mfc 1494302000)
-ms, -match-string string match response with specified string (-ms admin)
-ms, -match-string string match response with specified string (case insensitive) (-ms admin)
-mr, -match-regex string match response with specified regex (-mr admin)
-mcdn, -match-cdn string[] match host with specified cdn provider (oracle, google, azure, cloudflare, cloudfront, fastly, incapsula, leaseweb, akamai, sucuri)
-mrt, -match-response-time string match response with specified response time in seconds (-mrt '< 1')
Expand Down
3 changes: 2 additions & 1 deletion cmd/functional-test/testcases.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ scanme.sh {{binary}} -silent -body 'a=b'
scanme.sh {{binary}} -silent -exclude-cdn
scanme.sh {{binary}} -silent -ports https:443
scanme.sh {{binary}} -silent -ztls
https://scanme.sh?a=1*1 {{binary}} -silent
https://scanme.sh?a=1*1 {{binary}} -silent
https://scanme.sh:443 {{binary}} -asn
7 changes: 7 additions & 0 deletions cmd/httpx/httpx.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (

"github.com/projectdiscovery/gologger"
"github.com/projectdiscovery/httpx/runner"
errorutil "github.com/projectdiscovery/utils/errors"
)

func main() {
Expand Down Expand Up @@ -58,3 +59,9 @@ func main() {
httpxRunner.RunEnumeration()
httpxRunner.Close()
}

func init() {
if os.Getenv("DEBUG") != "" {
errorutil.ShowStackTrace = true
}
}
3 changes: 2 additions & 1 deletion cmd/integration-test/library.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ func (h *httpxLibrary) Execute() error {

httpxRunner.RunEnumeration()

expected := "https://scanme.sh:443"
// httpx removes default ports for simplicity Ref: https://pkg.go.dev/github.com/projectdiscovery/httpx/common/stringz#RemoveURLDefaultPort
expected := "https://scanme.sh"

if got != expected {
return errIncorrectResult(expected, got)
Expand Down
9 changes: 7 additions & 2 deletions common/httpx/httpx.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
retryablehttp "github.com/projectdiscovery/retryablehttp-go"
pdhttputil "github.com/projectdiscovery/utils/http"
stringsutil "github.com/projectdiscovery/utils/strings"
urlutil "github.com/projectdiscovery/utils/url"
"golang.org/x/net/context"
"golang.org/x/net/http2"
)
Expand Down Expand Up @@ -330,11 +331,15 @@ func (h *HTTPX) NewRequest(method, targetURL string) (req *retryablehttp.Request

// NewRequest from url
func (h *HTTPX) NewRequestWithContext(ctx context.Context, method, targetURL string) (req *retryablehttp.Request, err error) {
req, err = retryablehttp.NewRequestWithContext(ctx, method, targetURL, nil)
urlx, err := urlutil.ParseURL(targetURL, h.Options.Unsafe)
if err != nil {
return
return nil, err
}

req, err = retryablehttp.NewRequestFromURLWithContext(ctx, method, urlx, nil)
if err != nil {
return nil, err
}
// Skip if unsafe is used
if !h.Options.Unsafe {
// set default user agent
Expand Down
7 changes: 3 additions & 4 deletions common/stringz/stringz.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,19 +93,18 @@ func RemoveURLDefaultPort(rawURL string) string {
return rawURL
}

if u.Scheme == urlutil.HTTP && u.Port == "80" || u.Scheme == urlutil.HTTPS && u.Port == "443" {
u.Port = ""
if u.Scheme == urlutil.HTTP && u.Port() == "80" || u.Scheme == urlutil.HTTPS && u.Port() == "443" {
u.TrimPort()
}
return u.String()
}

func GetInvalidURI(rawURL string) (bool, string) {
if _, err := url.Parse(rawURL); err != nil {
if u, err := urlutil.Parse(rawURL); err == nil {
return true, u.RequestURI
return true, u.GetRelativePath()
}
}

return false, ""
}

Expand Down
Loading