Actions
Issue #1622
closedPulp event notifier not setting the right content type
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Master
Platform Release:
2.8.0
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 2
Sprint:
Quarter:
Description
1) Create a post sync notifier in pulp. There may be a pulp-admin way of doing this -> but Katello does it in the following way
path = /pulp/api/v2/events/, args = post,{"notifier_type_id":"http","notifier_config":{"url":"https://<SAT FQDN>/katello/api/v2/repositories/sync_complete?token=test"},"event_types":["repo.sync.finish"]},{"content_type"=>"application/json", "accept"=>"application/json", "Authorization"=>"OAuth oauth_body_hash=\"2jmj7l5rSw0yVb%2FvlWAYkK%2FYBwk%3D\", oauth_consumer_key=\"5N52BJQuADMGfHKMhzRV8NUfKUZvePw4\", oauth_nonce=\"b5L7Mkm0QXEi4WiM2j3Sdqz4CCPsdxnYClgBJ2dxyko\", oauth_signature=\"s%2BhM%2FjS%2FBMaFuu%2FpS%2FezpubMdcs%3D\", oauth_signature_method=\"HMAC-SHA1\", oauth_timestamp=\"1454430929\", oauth_version=\"1.0\"", "pulp-user"=>"admin"}
2) Sync any repo
Katello logs noticed the following error
2016-02-02T11:05:03 [app] [D] With body: {
| "error": {"message":"'Content-Type: application/x-www-form-urlencoded' is unsupported in API v2 for POST and PUT
requests. Please use 'Content-Type: application/json'."}
| }
So the sync complete notifier didnt set the content type correctly.
Added by Jeremy Cline almost 8 years ago
Updated by jcline@redhat.com almost 8 years ago
- Status changed from NEW to POST
- Assignee set to jcline@redhat.com
- Triaged changed from No to Yes
Updated by jcline@redhat.com almost 8 years ago
- Status changed from POST to MODIFIED
Updated by dkliban@redhat.com almost 8 years ago
- Status changed from MODIFIED to 5
Updated by dkliban@redhat.com over 7 years ago
- Status changed from 5 to CLOSED - CURRENTRELEASE
Actions
Ensure the HTTP event notifier sends JSON-encoded bodies.
By default requests form-encodes post requests. However, there is a json kwarg that will dump the provided dictionary to JSON and POST it with the correct content type.