Skip to content

Commit

Permalink
Remove Content-Type for GETs
Browse files Browse the repository at this point in the history
  • Loading branch information
David Bouchare committed Apr 18, 2019
1 parent a9f0f35 commit d22df1a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions http_check/datadog_checks/http_check/http_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,12 @@ def send_status_down(loginfo, down_msg):
if suppress_warning:
warnings.simplefilter('ignore', InsecureRequestWarning)

# GET requests do not need headers that include Content-Type, as some firewalls may block them
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Type
if method == 'get' and headers['Content-Type'] == 'application/x-www-form-urlencoded':
headers.pop('Content-Type')
self.log.debug("Stripping headers from Content-Type")

r = sess.request(
method.upper(),
addr,
Expand Down

0 comments on commit d22df1a

Please sign in to comment.