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(net/ghttp): invalid CORS AllowOrigin parsing from referer #3990

Merged
merged 2 commits into from
Dec 1, 2024

Conversation

yzy613
Copy link
Contributor

@yzy613 yzy613 commented Nov 29, 2024

#3986 (comment)

Example 2 has a problem.

referer := "https://example.com/path/to/page.html"
if p := gstr.PosR(referer, "/", 6); p != -1 {
	fmt.Println(referer[:p]) //https://example.com/path/to
} else {
	fmt.Println(referer)
}

@yzy613 yzy613 changed the title fix: get origin through referer fix(net/ghttp): get origin through referer Nov 29, 2024
@gqcn gqcn merged commit e572ed0 into gogf:master Dec 1, 2024
20 checks passed
@yzy613 yzy613 deleted the discuss/cors branch December 1, 2024 05:40
@gqcn gqcn changed the title fix(net/ghttp): get origin through referer fix(net/ghttp): get AllowOrigin from referer for CORS Dec 11, 2024
@gqcn gqcn changed the title fix(net/ghttp): get AllowOrigin from referer for CORS fix(net/ghttp): invalid CORS AllowOrigin parsing from referer Dec 11, 2024
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.

2 participants