File tree Expand file tree Collapse file tree 3 files changed +8
-1
lines changed
Expand file tree Collapse file tree 3 files changed +8
-1
lines changed Original file line number Diff line number Diff line change 3535- Craig Thompson [ @craigdsthompson ] ( https://github.com/craigdsthompson )
3636- Dalton Durst [ @UniversalSuperBox ] ( https://github.com/UniversalSuperBox )
3737- Damian Sweeney [ @damianfs ] ( https://github.com/damianfs )
38+ - Daniel Bosk [ @dbosk ] ( https://github.com/dbosk )
3839- Daniel Brinkman [ @DanBrink91 ] ( https://github.com/DanBrink91 )
3940- Daniel Grobani [ @dgrobani ] ( https://github.com/dgrobani )
4041- Daniel Molares [ @dmols ] ( https://github.com/dmols )
Original file line number Diff line number Diff line change 55### General
66
77- Updated ` RateLimitExceeded ` exception to trigger on HTTP 429 instead of old 403.
8+ - Add a default User-Agent header
89
910## [ 3.4.0] - 2025-11-10
1011
Original file line number Diff line number Diff line change @@ -133,7 +133,7 @@ def request(
133133 _url = None ,
134134 _kwargs = None ,
135135 json = False ,
136- ** kwargs
136+ ** kwargs ,
137137 ):
138138 """
139139 Make a request to the Canvas API and return the response.
@@ -167,6 +167,8 @@ def request(
167167 :type json: `bool`
168168 :rtype: :class:`requests.Response`
169169 """
170+ from canvasapi import __version__
171+
170172 # Check for specific URL endpoints available from Canvas. If not
171173 # specified, pass the given URL and move on.
172174 if not _url :
@@ -185,6 +187,9 @@ def request(
185187 auth_header = {"Authorization" : "Bearer {}" .format (self .access_token )}
186188 headers .update (auth_header )
187189
190+ if "User-Agent" not in headers :
191+ headers ["User-Agent" ] = f"python-canvasapi/{ __version__ } "
192+
188193 # Convert kwargs into list of 2-tuples and combine with _kwargs.
189194 _kwargs = _kwargs or []
190195 _kwargs .extend (kwargs .items ())
You can’t perform that action at this time.
0 commit comments