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

fix: unexpected path in httpugprade #2773

Merged
merged 1 commit into from Nov 24, 2023

Conversation

ghosx
Copy link
Contributor

@ghosx ghosx commented Nov 22, 2023

resolves: #2740

Test the different performances of http.NewRequest for //s123/randomstring123 and /s123/randomstring123

package main

import (
	"fmt"
	"net/http"
	"os"
)

func main() {
	f1()
	f2()
}

func f1() {
	fmt.Println("f1:")
	s := "//s123/randomstring123"
	req, _ := http.NewRequest("GET", s, nil)
	req.Write(os.Stdout)
}

func f2() {
	fmt.Println("f2:")
	s := "/s123/randomstring123"
	req, _ := http.NewRequest("GET", s, nil)
	req.Write(os.Stdout)
}

Output:

go run .
f1:
GET /randomstring123 HTTP/1.1
Host: s123
User-Agent: Go-http-client/1.1

f2:
GET /s123/randomstring123 HTTP/1.1
Host: 
User-Agent: Go-http-client/1.1

Copy link
Contributor

@xiaokangwang xiaokangwang left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution. I think this pull request is ready to be merged.

@codecov-commenter
Copy link

Codecov Report

Attention: 8 lines in your changes are missing coverage. Please review.

Comparison is base (62428d8) 36.97% compared to head (f060300) 36.95%.
Report is 1 commits behind head on master.

Files Patch % Lines
transport/internet/httpupgrade/config.go 0.00% 7 Missing ⚠️
transport/internet/httpupgrade/dialer.go 0.00% 1 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2773      +/-   ##
==========================================
- Coverage   36.97%   36.95%   -0.03%     
==========================================
  Files         671      672       +1     
  Lines       39685    39692       +7     
==========================================
- Hits        14673    14667       -6     
- Misses      23391    23404      +13     
  Partials     1621     1621              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@xiaokangwang xiaokangwang merged commit 57d712a into v2fly:master Nov 24, 2023
39 of 40 checks passed
@ghosx ghosx deleted the bugfix/unexpectedpath branch November 24, 2023 07:51
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.

Unexpected path in httpugprade
3 participants