{"id":16589478,"url":"https://github.com/rnons/nodejs-http-issue","last_synced_at":"2025-03-06T11:25:22.459Z","repository":{"id":142888272,"uuid":"189925479","full_name":"rnons/nodejs-http-issue","owner":"rnons","description":null,"archived":false,"fork":false,"pushed_at":"2019-06-03T08:45:04.000Z","size":142,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-16T22:14:53.478Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rnons.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2019-06-03T03:01:24.000Z","updated_at":"2019-06-03T08:45:06.000Z","dependencies_parsed_at":"2023-04-10T09:20:19.137Z","dependency_job_id":null,"html_url":"https://github.com/rnons/nodejs-http-issue","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rnons%2Fnodejs-http-issue","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rnons%2Fnodejs-http-issue/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rnons%2Fnodejs-http-issue/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rnons%2Fnodejs-http-issue/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rnons","download_url":"https://codeload.github.com/rnons/nodejs-http-issue/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242198828,"owners_count":20088119,"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-10-11T23:08:58.722Z","updated_at":"2025-03-06T11:25:22.439Z","avatar_url":"https://github.com/rnons.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# A nodejs http or stream module issue (solved)\n\nWhen sending some json string to a nodejs http server, the request body on the server side is somehow different from what I sent.\n\n[Solution](https://github.com/nodejs/help/issues/1945#issuecomment-498137449).\n\n## How to reproduce\n\n1. start a http server that writes the request body to `node_req.json`.\n    ```\n    node server.js\n    ```\n2. send a local file `data.json` to the server\n    ```\n    curl -d @data.json http://localhost:3050\n    ```\n3. compare `data.json` with `node_req.json`\n    ```\n    diff data.json node_req.json\n    ```\n\nExpecting `diff` to return status code 0, which means `data.json` is equivalent to `node_req.json`. But `diff` actually returns status code 1.\n\nAs a comparison, I made another http server in python. Run\n\n```\npython3 server.py\ncurl -d @data.json http://localhost:3060\ndiff data.json py_req.json\n```\n\nand diff returns 0.\n\n## the different part\n\n```\njs-beautify data.json -o data_beautified.json\njs-beautify node_req.json -o node_req_beautified.json\ndiff data_beautified.json node_req_beautified.json\n```\n\ngives this output\n\n```\n1083c1083\n\u003c         [\"¥state¤None¦screen¥Large¤name¨lg:-m-10\", \"¥value§-2.5rem¨property¦margin¨disabledÂ\"],\n---\n\u003e         [\"¥state¤None¦screen¥Large¤name¨lg:-m-10\", \"¥value§-2.5rem¨property��margin¨disabledÂ\"],\n2130c2130\n\u003c         [\"¥state¤None¦screen¥Large¤name¯lg:inline-block\", \"¥value¬inline-block¨property§display¨disabledÂ\"],\n---\n\u003e         [\"¥state¤None¦screen¥Large¤name��lg:inline-block\", \"¥value¬inline-block¨property§display¨disabledÂ\"],\n6869c6869\n\u003c         [\"¥state¤None¦screen¥Large¤name´xl:align-text-bottom\", \"¥value«text-bottom¨property®vertical-align¨disabledÂ\"],\n---\n\u003e         [\"¥state¤None¦screen¥Large¤name´xl:align-text-bottom\", \"��value«text-bottom¨property®vertical-align¨disabledÂ\"],\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frnons%2Fnodejs-http-issue","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frnons%2Fnodejs-http-issue","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frnons%2Fnodejs-http-issue/lists"}