Go CORS handler is a Go package that provides a configurable middleware handler for Cross-Origin Resource Sharing in net/http applications. It is designed to make CORS behavior explicit, predictable, and easy to insert into an existing HTTP handler chain. Developers can define which origins, methods, headers, and credentials are allowed, instead of scattering CORS logic across routes. The library also handles preflight requests, making it useful for APIs consumed by browsers, frontend apps, and third-party clients. Because it returns a standard net/http handler, it fits naturally into many Go web stacks and routers. It is a focused utility for teams that need reliable CORS handling without adopting a larger framework.

Features

  • Configurable allowed origins
  • Allowed methods and headers
  • Credential support controls
  • Preflight request handling
  • Standard net/http middleware
  • Small Go library footprint

Project Samples

Project Activity

See All Activity >

Categories

Libraries

License

MIT License

Follow Go CORS handler

Go CORS handler Web Site

Other Useful Business Software
MongoDB Atlas runs apps anywhere Icon
MongoDB Atlas runs apps anywhere

Deploy in 115+ regions with the modern database for every enterprise.

MongoDB Atlas gives you the freedom to build and run modern applications anywhere—across AWS, Azure, and Google Cloud. With global availability in over 115 regions, Atlas lets you deploy close to your users, meet compliance needs, and scale with confidence across any geography.
Start Free
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of Go CORS handler!

Additional Project Details

Programming Language

Go

Related Categories

Go Libraries

Registered

2026-05-12