Skip to content

fix(errors): handle Content-Type parameters - #882

Open
fallintoplace wants to merge 2 commits into
fastly:mainfrom
fallintoplace:fix/http-error-content-type
Open

fallintoplace wants to merge 2 commits into
fastly:mainfrom
fallintoplace:fix/http-error-content-type

Conversation

@fallintoplace

@fallintoplace fallintoplace commented Oct 4, 2026 •

Copy link
Copy Markdown

Change summary

Fix HTTP error decoding when the Content-Type header includes parameters. This keeps structured API error fields in the decoded error.

All Submissions:

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?

Changes to Core Features:

  • Have you written new tests for your core changes, as applicable?
  • Have you successfully run tests with your changes locally?

User Impact

Parameterized Content-Type values now use the correct decoder, preserving JSON:API and problem details fields.

Are there any considerations that need to be addressed for release?

No breaking changes.

@fallintoplace
fallintoplace requested a review from a team as a code owner October 4, 2026 14:40
@WhiteAbeLincoln

WhiteAbeLincoln commented Oct 5, 2026 •

Copy link
Copy Markdown

Thanks @fallintoplace! Please use our PR template:

### Change summary

 <!--
Briefly describe the changes introduced in this pull request. Include context or
reasoning behind the changes, even if they seem minor. If relevant, link to any
related discussions (e.g. Slack threads, tickets, documents).
-->

 All Submissions:

* [ ] Have you followed the guidelines in our Contributing document?
* [ ] Have you checked to ensure there aren't other open [Pull Requests](https://github.com/fastly/go-fastly/pulls) for the same update/change?

<!-- You can erase any parts of this template not applicable to your Pull Request. -->

### New Feature Submissions:

* [ ] Does your submission pass tests?

### Changes to Core Features:

* [ ] Have you written new tests for your core changes, as applicable?
* [ ] Have you successfully run tests with your changes locally?

### User Impact

<!-- What is the user impact of this change? -->

### Are there any considerations that need to be addressed for release?

<!-- Any breaking changes, etc -->

@WhiteAbeLincoln
WhiteAbeLincoln requested a review from rcaril October 5, 2026 14:58
@rcaril

rcaril commented Oct 5, 2026

Copy link
Copy Markdown
Member

Hi @fallintoplace - thanks for your contribution. I took a look through our recorded API responses and didn't find any error responses where the Content-Type included parameters. Can you point out where you are seeing this behavior (which endpoint and the exact Content-Type header returned)?

@fallintoplace

Copy link
Copy Markdown
Author

Fastly documents PATCH /service-authorizations responses with Content-Type: application/vnd.api+json; ext=bulk: https://docs-archive.fastly.com/snapshots/static/2020-04-30-api-aio.pdf

@rcaril

rcaril commented Oct 5, 2026

Copy link
Copy Markdown
Member

Fastly documents PATCH /service-authorizations responses with Content-Type: application/vnd.api+json; ext=bulk: https://docs-archive.fastly.com/snapshots/static/2020-04-30-api-aio.pdf

Thanks for providing the reference @fallintoplace. FYI - the document you linked is archived - the live doc lives here: https://www.fastly.com/documentation/reference/api/account/service-authorization/.

With that being said, go-fastly does not call the bulk PATCH / DELETE endpoints that you referenced here. Are there any other live examples that you are utilizing that are impacted by the behavior you are pointing out?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants