{"id":13492862,"url":"https://github.com/nytimes/gziphandler","last_synced_at":"2025-03-28T11:30:56.168Z","repository":{"id":26257033,"uuid":"29704218","full_name":"nytimes/gziphandler","owner":"nytimes","description":"Go middleware to gzip HTTP responses","archived":false,"fork":false,"pushed_at":"2024-08-15T09:51:10.000Z","size":135,"stargazers_count":871,"open_issues_count":24,"forks_count":129,"subscribers_count":44,"default_branch":"master","last_synced_at":"2024-10-29T19:59:47.434Z","etag":null,"topics":["go","golang","gzip","http","middleware"],"latest_commit_sha":null,"homepage":"https://godoc.org/github.com/NYTimes/gziphandler","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nytimes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-01-22T22:43:10.000Z","updated_at":"2024-10-28T16:44:13.000Z","dependencies_parsed_at":"2024-01-15T15:46:06.807Z","dependency_job_id":"2a51e797-decd-4e9e-989d-97fa4058c10c","html_url":"https://github.com/nytimes/gziphandler","commit_stats":{"total_commits":67,"total_committers":34,"mean_commits":"1.9705882352941178","dds":0.8805970149253731,"last_synced_commit":"2f8bb1d30d9d69c8e0c3714da5a9917125a87769"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nytimes%2Fgziphandler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nytimes%2Fgziphandler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nytimes%2Fgziphandler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nytimes%2Fgziphandler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nytimes","download_url":"https://codeload.github.com/nytimes/gziphandler/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246020792,"owners_count":20710822,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["go","golang","gzip","http","middleware"],"created_at":"2024-07-31T19:01:09.950Z","updated_at":"2025-03-28T11:30:55.843Z","avatar_url":"https://github.com/nytimes.png","language":"Go","readme":"Gzip Handler\n============\n\nThis is a tiny Go package which wraps HTTP handlers to transparently gzip the\nresponse body, for clients which support it. Although it's usually simpler to\nleave that to a reverse proxy (like nginx or Varnish), this package is useful\nwhen that's undesirable.\n\n## Install\n```bash\ngo get -u github.com/NYTimes/gziphandler\n```\n\n## Usage\n\nCall `GzipHandler` with any handler (an object which implements the\n`http.Handler` interface), and it'll return a new handler which gzips the\nresponse. For example:\n\n```go\npackage main\n\nimport (\n\t\"io\"\n\t\"net/http\"\n\t\"github.com/NYTimes/gziphandler\"\n)\n\nfunc main() {\n\twithoutGz := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tw.Header().Set(\"Content-Type\", \"text/plain\")\n\t\tio.WriteString(w, \"Hello, World\")\n\t})\n\n\twithGz := gziphandler.GzipHandler(withoutGz)\n\n\thttp.Handle(\"/\", withGz)\n\thttp.ListenAndServe(\"0.0.0.0:8000\", nil)\n}\n```\n\n\n## Documentation\n\nThe docs can be found at [godoc.org][docs], as usual.\n\n\n## License\n\n[Apache 2.0][license].\n\n\n\n\n[docs]:     https://godoc.org/github.com/NYTimes/gziphandler\n[license]:  https://github.com/NYTimes/gziphandler/blob/master/LICENSE\n","funding_links":[],"categories":["Go","\u003ca id=\"e1fc1d87056438f82268742dc2ba08f5\"\u003e\u003c/a\u003e事件响应\u0026\u0026取证\u0026\u0026内存取证\u0026\u0026数字取证","Go (134)","Repositories"],"sub_categories":["\u003ca id=\"d0f59814394c5823210aa04a8fcd1220\"\u003e\u003c/a\u003e事件响应\u0026\u0026IncidentResponse"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnytimes%2Fgziphandler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnytimes%2Fgziphandler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnytimes%2Fgziphandler/lists"}