{"id":22286300,"url":"https://github.com/fadeevab/python-3-simple-server-with-header-manipulations","last_synced_at":"2025-07-20T17:04:40.661Z","repository":{"id":117607603,"uuid":"258187955","full_name":"fadeevab/python-3-simple-server-with-header-manipulations","owner":"fadeevab","description":"Simple Python 3 server to experiment with header manipulation, e.g. cookie, origin, etc.","archived":false,"fork":false,"pushed_at":"2020-05-01T17:58:06.000Z","size":3,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-25T20:47:01.123Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","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/fadeevab.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-04-23T11:57:57.000Z","updated_at":"2022-10-11T08:45:14.000Z","dependencies_parsed_at":null,"dependency_job_id":"ecff6c14-ad3a-4337-814b-c27bda2a7136","html_url":"https://github.com/fadeevab/python-3-simple-server-with-header-manipulations","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/fadeevab/python-3-simple-server-with-header-manipulations","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fadeevab%2Fpython-3-simple-server-with-header-manipulations","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fadeevab%2Fpython-3-simple-server-with-header-manipulations/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fadeevab%2Fpython-3-simple-server-with-header-manipulations/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fadeevab%2Fpython-3-simple-server-with-header-manipulations/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fadeevab","download_url":"https://codeload.github.com/fadeevab/python-3-simple-server-with-header-manipulations/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fadeevab%2Fpython-3-simple-server-with-header-manipulations/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266161906,"owners_count":23885928,"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":[],"created_at":"2024-12-03T16:55:27.590Z","updated_at":"2025-07-20T17:04:40.653Z","avatar_url":"https://github.com/fadeevab.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Simple Python 3 server with header manipulations,\ne.g. `Set-Cookie`, `Origin`, and `Host` in the current example.\n\n## How-To Use\n\nRun the server:\n```\npython3 ./server-example-with-headers.py\n```\n\n1. `Origin` header is forged by client:\n    ```\n    $ curl localhost:8080 -H 'Origin: fadeevab.com'\n\n    I believe this request is from fadeevab.com!\n    Hello, world!\n    ```\n\n2. `Set-Cookie` header is returned:\n    ```\n    $ curl localhost:8080 -v\n\n    ....\n    \u003c HTTP/1.0 200 OK\n    \u003c Server: BaseHTTP/0.6 Python/3.7.5\n    \u003c Date: ...\n    \u003c Set-Cookie: auth=1234; Domain=sub.localhost\n    ```\n    `-v` is just to show headers\n\n## Tip\nTo experiment with subdomains on your local machine just modify `/etc/hosts` file (`C:\\\\Windows\\\\System32\\\\Drivers\\\\etc\\\\hosts`) like the following:\n```\n127.0.0.1 sub.localhost\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffadeevab%2Fpython-3-simple-server-with-header-manipulations","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffadeevab%2Fpython-3-simple-server-with-header-manipulations","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffadeevab%2Fpython-3-simple-server-with-header-manipulations/lists"}