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
Go from Code to Production URL in Seconds Icon
Go from Code to Production URL in Seconds

Cloud Run deploys apps in any language instantly. Scales to zero. Pay only when code runs.

Skip the Kubernetes configs. Cloud Run handles HTTPS, scaling, and infrastructure automatically. Two million requests free per month.
Try it 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

23 hours ago