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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃敟Feature: add function to check if request came from localhost #1671

Merged
merged 2 commits into from Dec 28, 2021

Conversation

vecpeng
Copy link
Contributor

@vecpeng vecpeng commented Dec 28, 2021

Close #1629 .
Usages

func handleSomething(c *fiber.Ctx) error {
	// Print true when request came from localhost
	fmt.Println(c.IsFromLocal())
	return nil
}

@ReneWerner87
Copy link
Member

thanks for the feature

please provide a part in our docs(@vecpeng )
https://github.com/gofiber/docs/blob/master/api/ctx.md

@vecpeng
Copy link
Contributor Author

vecpeng commented Dec 28, 2021

OK, I open a pull request here. gofiber/docs#218

@ReneWerner87 ReneWerner87 merged commit bd19adc into gofiber:master Dec 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

馃殌 Function to check if request came from localhost
2 participants