{"id":40739956,"url":"https://github.com/blizzy78/conditional-http","last_synced_at":"2026-01-21T15:04:59.085Z","repository":{"id":57574574,"uuid":"353809121","full_name":"blizzy78/conditional-http","owner":"blizzy78","description":"Conditional HTTP middleware for Go","archived":false,"fork":false,"pushed_at":"2021-04-02T10:55:13.000Z","size":11,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2023-07-27T21:57:52.605Z","etag":null,"topics":["go","golang","golang-library","http","middleware"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/blizzy78.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-04-01T19:43:57.000Z","updated_at":"2023-06-08T20:01:25.000Z","dependencies_parsed_at":"2022-09-18T06:20:13.567Z","dependency_job_id":null,"html_url":"https://github.com/blizzy78/conditional-http","commit_stats":null,"previous_names":[],"tags_count":2,"template":null,"template_full_name":null,"purl":"pkg:github/blizzy78/conditional-http","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blizzy78%2Fconditional-http","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blizzy78%2Fconditional-http/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blizzy78%2Fconditional-http/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blizzy78%2Fconditional-http/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/blizzy78","download_url":"https://codeload.github.com/blizzy78/conditional-http/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blizzy78%2Fconditional-http/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28635123,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-21T14:50:40.221Z","status":"ssl_error","status_checked_at":"2026-01-21T14:48:59.225Z","response_time":86,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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","golang-library","http","middleware"],"created_at":"2026-01-21T15:04:58.838Z","updated_at":"2026-01-21T15:04:59.079Z","avatar_url":"https://github.com/blizzy78.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/blizzy78/conditional-http.svg?branch=master)](https://travis-ci.org/blizzy78/conditional-http) [![Coverage Status](https://coveralls.io/repos/github/blizzy78/conditional-http/badge.svg?branch=master)](https://coveralls.io/github/blizzy78/conditional-http?branch=master) [![GoDoc](https://pkg.go.dev/badge/github.com/blizzy78/conditional-http)](https://pkg.go.dev/github.com/blizzy78/conditional-http)\n\n\nConditional HTTP Middleware for Go\n==================================\n\nThis package for Go provides middleware for conditional HTTP requests supporting the ETag, Last-Modified,\nIf-Modified-Since, and If-None-Match headers, according to [RFC 7232]. When matches are successful,\nit will automatically send the 304 Not Modified status code.\n\n\nUsage\n-----\n\n```go\nimport \"github.com/blizzy78/conditional-http/handler\"\n```\n\n```go\n// your regular downstream handler\nvar h http.Handler = ...\n\n// add Last-Modified header to responses\nh, _ = handler.LastModifiedHandler(\n\tfunc(w http.ResponseWriter, r *http.Request) (time.Time, bool) {\n\t\t// produce last modification date for r and w\n\t\tlastMod := ...\n\t\treturn lastMod, true\n\t},\n\thandler.BeforeHeaders, h)\n\n// add ETag header to responses\nh = handler.ETagHandler(\n\tfunc(w http.ResponseWriter, r *http.Request) (handler.ETag, bool) {\n\t\t// produce entity-tag for r and w\n\t\teTag := handler.ETag{\n\t\t\tTag: \"...\",\n\t\t\tWeak: true,\n\t\t}\n\t\treturn eTag, true\n\t},\n\thandler.AfterHeaders, h)\n\n// check requests for If-Modified-Since and If-None-Match headers,\n// and send 304 Not Modified in responses if successful\nh = handler.IfNoneMatchIfModifiedSinceHandler(true, h)\n```\n\n\nLicense\n-------\n\nThis package is licensed under the MIT license.\n\n\n\n[RFC 7232]: https://www.rfc-editor.org/rfc/rfc7232.txt\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblizzy78%2Fconditional-http","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblizzy78%2Fconditional-http","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblizzy78%2Fconditional-http/lists"}