Title: RFE: We should catch all 301, 302 redirects · Issue #1485 · python-gitlab/python-gitlab · GitHub
Open Graph Title: RFE: We should catch all 301, 302 redirects · Issue #1485 · python-gitlab/python-gitlab
X Title: RFE: We should catch all 301, 302 redirects · Issue #1485 · python-gitlab/python-gitlab
Description: Currently we raise an error if there is a 301, 302 redirect from an http URL to an httpS URL for any non GET methods. But we don't raise an error for any other redirects. This causes two problems: PUT requests that are redirected get cha...
Open Graph Description: Currently we raise an error if there is a 301, 302 redirect from an http URL to an httpS URL for any non GET methods. But we don't raise an error for any other redirects. This causes two problems: ...
X Description: Currently we raise an error if there is a 301, 302 redirect from an http URL to an httpS URL for any non GET methods. But we don't raise an error for any other redirects. This causes two proble...
Opengraph URL: https://github.com/python-gitlab/python-gitlab/issues/1485
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"RFE: We should catch all 301, 302 redirects","articleBody":"Currently we raise an error if there is a 301, 302 redirect from an `http` URL to an `httpS` URL for any non `GET` methods.\r\n\r\nBut we don't raise an error for any other redirects.\r\n\r\nThis causes two problems:\r\n\r\n1. `PUT` requests that are redirected get changed to `GET` requests which don't perform the correct action but raise no error. This is because the `GET` response succeeds but since it wasn't a `PUT` it doesn't update. This can be seen by updating a user status. It raises no errors but the status does not change. See issue https://github.com/python-gitlab/python-gitlab/issues/1432\r\n2. `POST` requests blow up with hard to debug tracebacks. See below. Also see issue https://github.com/python-gitlab/python-gitlab/issues/1477\r\n\r\n\r\nAn example of attempting to upload an SSH key on a URL that redirects with 302 for the `POST` request:\r\n```\r\nTraceback (most recent call last):\r\n File \"/home/jlvillal/.local/lib/python3.9/site-packages/gitlab/base.py\", line 77, in __getattr__\r\n return self.__dict__[\"_updated_attrs\"][name]\r\nKeyError: '_managers'\r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nTraceback (most recent call last):\r\n File \"/home/jlvillal/sources/local/py-gitlab-testing/./tt.py\", line 109, in \u003cmodule\u003e\r\n sys.exit(main())\r\n File \"/home/jlvillal/sources/local/py-gitlab-testing/./tt.py\", line 82, in main\r\n k = user.keys.create({\"title\": \"My key\", \"key\": SSH_KEY})\r\n File \"/home/jlvillal/.local/lib/python3.9/site-packages/gitlab/exceptions.py\", line 287, in wrapped_f\r\n return f(*args, **kwargs)\r\n File \"/home/jlvillal/.local/lib/python3.9/site-packages/gitlab/mixins.py\", line 325, in create\r\n return self._obj_cls(self, server_data)\r\n File \"/home/jlvillal/.local/lib/python3.9/site-packages/gitlab/base.py\", line 62, in __init__\r\n self._create_managers()\r\n File \"/home/jlvillal/.local/lib/python3.9/site-packages/gitlab/base.py\", line 145, in _create_managers\r\n managers = getattr(self, \"_managers\", None)\r\n File \"/home/jlvillal/.local/lib/python3.9/site-packages/gitlab/base.py\", line 80, in __getattr__\r\n value = self.__dict__[\"_attrs\"][name]\r\nTypeError: list indices must be integers or slices, not str\r\n```","author":{"url":"https://github.com/JohnVillalovos","@type":"Person","name":"JohnVillalovos"},"datePublished":"2021-05-30T23:14:26.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":11},"url":"https://github.com/1485/python-gitlab/issues/1485"}
| 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:af6ba2fa-14ce-3b2e-10ab-937f83f0e78c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C3AE:1B215B:207AD36:2A32DD7:69770B35 |
| html-safe-nonce | d6cf45302a52772fd08b3a95e18077cbf9088a7f7b1ee25067ce53bf7f70d52e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDM0FFOjFCMjE1QjoyMDdBRDM2OjJBMzJERDc6Njk3NzBCMzUiLCJ2aXNpdG9yX2lkIjoiNjI1MDMyMDAzMzM2ODk2Nzk4OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | e31533723c2b241889024fd7c76300ff0a99e71c6b8b44647a8fa218c8bbb701 |
| hovercard-subject-tag | issue:906910329 |
| 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-gitlab/python-gitlab/1485/issue_layout |
| twitter:image | https://opengraph.githubassets.com/9bbdcd903479aeb8e328500d50147eba5422a6a658057a2f2a61b656f53bbe57/python-gitlab/python-gitlab/issues/1485 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/9bbdcd903479aeb8e328500d50147eba5422a6a658057a2f2a61b656f53bbe57/python-gitlab/python-gitlab/issues/1485 |
| og:image:alt | Currently we raise an error if there is a 301, 302 redirect from an http URL to an httpS URL for any non GET methods. But we don't raise an error for any other redirects. This causes two problems: ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | JohnVillalovos |
| hostname | github.com |
| expected-hostname | github.com |
| None | 01d198479908d09a841b2febe8eb105a81af2af7d81830960fe0971e1f4adc09 |
| turbo-cache-control | no-preview |
| go-import | github.com/python-gitlab/python-gitlab git https://github.com/python-gitlab/python-gitlab.git |
| octolytics-dimension-user_id | 28886265 |
| octolytics-dimension-user_login | python-gitlab |
| octolytics-dimension-repository_id | 8077625 |
| octolytics-dimension-repository_nwo | python-gitlab/python-gitlab |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 8077625 |
| octolytics-dimension-repository_network_root_nwo | python-gitlab/python-gitlab |
| 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 | f752335dbbea672610081196a1998e39aec5e14b |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width