Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

RFE: We should catch all 301, 302 redirects #1485

Closed
Assignees
JohnVillalovosmax-wittignejch
@JohnVillalovos

Description

@JohnVillalovos

Currently we raise an error if there is a 301, 302 redirect from anhttp URL to anhttpS URL for any nonGET methods.

But we don't raise an error for any other redirects.

This causes two problems:

  1. PUT requests that are redirected get changed toGET requests which don't perform the correct action but raise no error. This is because theGET response succeeds but since it wasn't aPUT it doesn't update. This can be seen by updating a user status. It raises no errors but the status does not change. See issueChanging milestone of issue does not work #1432
  2. POST requests blow up with hard to debug tracebacks. See below. Also see issueNot possible to create note in issue #1477

An example of attempting to upload an SSH key on a URL that redirects with 302 for thePOST request:

Traceback (most recent call last):  File "/home/jlvillal/.local/lib/python3.9/site-packages/gitlab/base.py", line 77, in __getattr__    return self.__dict__["_updated_attrs"][name]KeyError: '_managers'During handling of the above exception, another exception occurred:Traceback (most recent call last):  File "/home/jlvillal/sources/local/py-gitlab-testing/./tt.py", line 109, in <module>    sys.exit(main())  File "/home/jlvillal/sources/local/py-gitlab-testing/./tt.py", line 82, in main    k = user.keys.create({"title": "My key", "key": SSH_KEY})  File "/home/jlvillal/.local/lib/python3.9/site-packages/gitlab/exceptions.py", line 287, in wrapped_f    return f(*args, **kwargs)  File "/home/jlvillal/.local/lib/python3.9/site-packages/gitlab/mixins.py", line 325, in create    return self._obj_cls(self, server_data)  File "/home/jlvillal/.local/lib/python3.9/site-packages/gitlab/base.py", line 62, in __init__    self._create_managers()  File "/home/jlvillal/.local/lib/python3.9/site-packages/gitlab/base.py", line 145, in _create_managers    managers = getattr(self, "_managers", None)  File "/home/jlvillal/.local/lib/python3.9/site-packages/gitlab/base.py", line 80, in __getattr__    value = self.__dict__["_attrs"][name]TypeError: list indices must be integers or slices, not str

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp