-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
adds support for OPTIONS method #7804
Conversation
Codecov Report
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
Can we split this PR into 3 though? One for datadog_checks_base, one for datadog_checks_dev and lastly one for the http_check
integration?
Also in-between we'll want to release datadog_checks_base and bump the datadog_checks_base
dependency for http_check
@@ -313,6 +313,9 @@ def patch(self, url, **options): | |||
def delete(self, url, **options): | |||
return self._request('delete', url, options) | |||
|
|||
def options_method(self, url, **options): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's name that options
to match how requests
names it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for taking a look Florian! I named it options_method
so that it wouldn't conflict with the self.options
that already exists and cause a TypeError: 'dict' object is not callable
:
integrations-core/datadog_checks_base/datadog_checks/base/utils/http.py
Lines 259 to 266 in 2b3d4c9
self.options = { | |
'auth': auth, | |
'cert': cert, | |
'headers': headers, | |
'proxies': proxies, | |
'timeout': (connect_timeout, read_timeout), | |
'verify': verify, | |
} |
Are there ways I can follow convention and name it options
without conflicting with self.options
or should I keep it as is? I considered re-naming self.options
, but I was concerned about re-naming it across the codebase and introducing bugs. Let me know what you think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hadn't thought of that, that's a bit unfortunate and we'd have to rename options
in integrations as well + custom checks may rely on this. So let's go with options_method
then.
What does this PR do?
Adds support for the OPTIONS HTTP method to the RequestsWrapper
Motivation
Support case
Additional Notes
Review checklist (to be filled by reviewers)
changelog/
andintegration/
labels attached