Home / Function/ validateSecFetchSite() — fiber Function Reference

validateSecFetchSite() — fiber Function Reference

Architecture documentation for the validateSecFetchSite() function in csrf.go from the fiber codebase.

Entity Profile

Dependency Diagram

graph TD
  9b825ced_c480_49aa_3be3_aaf1dc052ea3["validateSecFetchSite()"]
  57b9eed3_6274_c073_f0db_e3c30b2a59fe["csrf.go"]
  9b825ced_c480_49aa_3be3_aaf1dc052ea3 -->|defined in| 57b9eed3_6274_c073_f0db_e3c30b2a59fe
  c524454a_687b_b78d_a451_724040543641["New()"]
  c524454a_687b_b78d_a451_724040543641 -->|calls| 9b825ced_c480_49aa_3be3_aaf1dc052ea3
  style 9b825ced_c480_49aa_3be3_aaf1dc052ea3 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

middleware/csrf/csrf.go lines 322–335

func validateSecFetchSite(c fiber.Ctx) error {
	secFetchSite := utils.Trim(c.Get(fiber.HeaderSecFetchSite), ' ')

	if secFetchSite == "" {
		return nil
	}

	switch utils.ToLower(secFetchSite) {
	case "same-origin", "none", "cross-site", "same-site":
		return nil
	default:
		return ErrFetchSiteInvalid
	}
}

Subdomains

Called By

Frequently Asked Questions

What does validateSecFetchSite() do?
validateSecFetchSite() is a function in the fiber codebase, defined in middleware/csrf/csrf.go.
Where is validateSecFetchSite() defined?
validateSecFetchSite() is defined in middleware/csrf/csrf.go at line 322.
What calls validateSecFetchSite()?
validateSecFetchSite() is called by 1 function(s): New.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free