Skip to content
This repository has been archived by the owner on Apr 26, 2020. It is now read-only.

Commit

Permalink
Fix Sentry "Unsupported media type 'application/json, application/jso…
Browse files Browse the repository at this point in the history
…n' in request" (#224)

* sentry: do not send Content-Type: application/json twice

The header is already set by called Httpie library. Calling ::header just adds a new header, does not do any replace.

Sentry does not recognize the request when we send the headers twice and fails with error:
```
  [RuntimeException] on [factcool-www3.superhosting.cz]
  Unable to create a release: Array
  (
  [detail] => Unsupported media type 'application/json, application/json' in request.
  )
```

* changelog: update
  • Loading branch information
hranicka authored and antonmedv committed May 29, 2019
1 parent c3ce86a commit f89d424
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

### Added
- Add APCu support in cachetool recipe
- Fixed Sentry deployment recipe, updated to work with latest deployer/deployer

## 6.2.0
[6.1.0...6.2.0](https://github.com/deployphp/recipes/compare/6.1.0...6.2.0)
Expand Down
2 changes: 0 additions & 2 deletions recipe/sentry.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ static function (&$value) use ($config) {
$releasesApiUrl
)
->header(sprintf('Authorization: Bearer %s', $config['token']))
->header('Content-Type: application/json')
->body($releaseData)
->getJson();

Expand Down Expand Up @@ -113,7 +112,6 @@ static function (&$value) use ($config) {
$releasesApiUrl . $response['version'] . '/deploys/'
)
->header(sprintf('Authorization: Bearer %s', $config['token']))
->header('Content-Type: application/json')
->body($deployData)
->getJson();

Expand Down

0 comments on commit f89d424

Please sign in to comment.