Title: HTTP20Adapter sends extra headers ?? · Issue #416 · python-hyper/hyper · GitHub
Open Graph Title: HTTP20Adapter sends extra headers ?? · Issue #416 · python-hyper/hyper
X Title: HTTP20Adapter sends extra headers ?? · Issue #416 · python-hyper/hyper
Description: import hashlib import requests import json from tls_version import MyAdapter import collections from userdata import UserData import time from random import randrange from hyper.contrib import HTTP20Adapter headers2 = [('Upgrade-Insecure...
Open Graph Description: import hashlib import requests import json from tls_version import MyAdapter import collections from userdata import UserData import time from random import randrange from hyper.contrib import HTTP...
X Description: import hashlib import requests import json from tls_version import MyAdapter import collections from userdata import UserData import time from random import randrange from hyper.contrib import HTTP...
Opengraph URL: https://github.com/python-hyper/hyper/issues/416
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"HTTP20Adapter sends extra headers ??","articleBody":"```\r\n\r\nimport hashlib\r\nimport requests\r\nimport json\r\nfrom tls_version import MyAdapter\r\nimport collections\r\nfrom userdata import UserData\r\nimport time\r\nfrom random import randrange\r\nfrom hyper.contrib import HTTP20Adapter\r\n\r\n\r\nheaders2 = [('Upgrade-Insecure-Requests', '1'),\r\n ('User-Agent', 'Mozilla/5.0 (Linux; Android 5.1.1; google Pixel 2 Build/LMY47I; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/74.0.3729.136 Mobile Safari/537.36'),\r\n ('Accept', 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3'),\r\n ('Accept-Encoding', 'gzip, deflate'),\r\n ('Accept-Language', 'es-ES,es;q=0.9,en-US;q=0.8,en;q=0.7'),\r\n\r\n ]\r\nclass post_calls():\r\n def start(self,headers_pass,body_pass,params,url,method):\r\n proxies = {\r\n 'http': ip,\r\n 'https': ip\r\n }\r\n body = str(body_pass)\r\n\r\n\r\n #send the POST request\r\n session = requests.session()\r\n session.mount('https://', MyAdapter())\r\n session.headers = collections.OrderedDict(headers_pass)\r\n if method == 'get':\r\n q = 'https://' + server + '.' + host\r\n q = q.replace('.www.', '.')\r\n session.mount('https://', HTTP20Adapter())\r\n print('q='+q)\r\n response = session.get(url, proxies=proxies, params=params, verify=charlesproxy)\r\n\r\n\r\n\r\n\r\n\r\ndef login_world2(sid): \r\n\r\n a = post_calls()\r\n q ='https://'+server+'.'+ host+'/login.php?mobile&sid='+sid+'&2'\r\n q = q.replace('.www.','.')\r\n params = {}\r\n url = q\r\n body = '0'\r\n login = a.start(headers2,body,params,url,'get')\r\n return login\r\n\r\nif __name__ == \"__main__\":\r\n login_get = login_world(sid)\r\n print(login_get)\r\n\r\n\r\n```\r\n\r\nand it sends those headers(im sniffing my code http/s traffic with charlesproxy)\r\n\r\n```\r\n:method: GET\r\n:scheme: https\r\n:authority: server.url.com\r\n:path: /login.php?mobile&sid=577f0967545d6acec94716d265dd4867fa4db4a446326ecde7486a97feede14702f4911438f4a4cd097677f0dd962786ef14b3f16f1184ee63a506155d522f53&2\r\nupgrade-insecure-requests: 1\r\nuser-agent: Mozilla/5.0 (Linux; Android 5.1.1; google Pixel 2 Build/LMY47I; wv) AppleWebKit/537.36 (KHTML\r\nuser-agent: like Gecko) Version/4.0 Chrome/74.0.3729.136 Mobile Safari/537.36\r\naccept: text/html\r\naccept: application/xhtml+xml\r\naccept: application/xml;q=0.9\r\naccept: image/webp\r\naccept: image/apng\r\naccept: */*;q=0.8\r\naccept: application/signed-exchange;v=b3\r\naccept-encoding: gzip\r\naccept-encoding: deflate\r\naccept-language: es-ES\r\naccept-language: es;q=0.9\r\naccept-language: en-US;q=0.8\r\naccept-language: en;q=0.7\r\n```\r\n\r\n\r\n\r\ni need to send them with orderectdict like these(with only ) requests goes good problem is thath server is http 2.0 so i need pseudo headers so i need hyper \r\n```\r\n:method: GET\r\n:authority: server.url.com\r\n:scheme: https\r\n:path: /login.php?mobile&sid=2ea530a62cb63af6c14be116b7df86ad85cd77c9a11aa3c881b3a460e6c14fbd1fd8b79bd66c9782073705cdff25e890e65b5aeb852fde24c2d54a6e4ee49890&2\r\nupgrade-insecure-requests: 1\r\nuser-agent: Mozilla/5.0 (Linux; Android 5.1.1; google Pixel 2 Build/LMY47I; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/74.0.3729.136 Mobile Safari/537.36\r\naccept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3\r\naccept-encoding: gzip, deflate\r\naccept-language: es-ES,es;q=0.9,en-US;q=0.8,en;q=0.7\r\n```\r\n","author":{"url":"https://github.com/qwerty32123","@type":"Person","name":"qwerty32123"},"datePublished":"2019-07-27T01:54:16Z","url":"https://github.com/python-hyper/hyper/issues/416"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:4dfe3a2b-53fd-8c60-a983-fc5d17b38329 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A66C:2E02E3:A4E2D:E42D9:6AFD9A12 |
| html-safe-nonce | 1e156fcafe4b85bfa6bd9b95a4bd8bd1e1e4bd40e914ef65234b2fe19d4e0471 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNjZDOjJFMDJFMzpBNEUyRDpFNDJEOTo2QUZEOUExMiIsInZpc2l0b3JfaWQiOiI1MTI4MjIxNzYxMDE5NDE5MTU0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | b44a0ac8337d57378a70d97d37e76f76180d7659f774bc767856ced2d798168e |
| hovercard-subject-tag | issue:473586687 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python-hyper/hyper/416/issue_layout |
| twitter:image | https://opengraph.githubassets.com/d881a5ce7cfcc9b8a23228ce91a458170e8028c9e00ac5829878a3d4cf63d73d/python-hyper/hyper/issues/416 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/d881a5ce7cfcc9b8a23228ce91a458170e8028c9e00ac5829878a3d4cf63d73d/python-hyper/hyper/issues/416 |
| og:image:alt | import hashlib import requests import json from tls_version import MyAdapter import collections from userdata import UserData import time from random import randrange from hyper.contrib import HTTP... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | qwerty32123 |
| hostname | github.com |
| expected-hostname | github.com |
| None | bc86424ef34a73b386237872800e922d149d65ba907f63d6f150a2dcb8433bea |
| turbo-cache-control | no-preview |
| go-import | github.com/python-hyper/hyper git https://github.com/python-hyper/hyper.git |
| octolytics-dimension-user_id | 13035907 |
| octolytics-dimension-user_login | python-hyper |
| octolytics-dimension-repository_id | 16165969 |
| octolytics-dimension-repository_nwo | python-hyper/hyper |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 16165969 |
| octolytics-dimension-repository_network_root_nwo | python-hyper/hyper |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 927a6c5ab1c32b38830f1b9d3050c0b9e9aa92e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width