Skip to content

Commit

Permalink
Fix API version for Netbox version > 4.x
Browse files Browse the repository at this point in the history
fixes #612
  • Loading branch information
btriller committed May 27, 2024
1 parent 1b397f0 commit 0f905bd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pynetbox/core/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def get_version(self):
self.normalize_url(self.base),
headers=headers,
)
if req.ok:
if req.ok or req.status_code == 403:
return req.headers.get("API-Version", "")
else:
raise RequestError(req)
Expand Down

0 comments on commit 0f905bd

Please sign in to comment.