Skip to content

fix: Remove custom Accept headers from search endpoints - #3820

Merged
gmlewis merged 1 commit into
google:masterfrom
alexandear-org:fix/search-remove-preview-headers
Nov 12, 2025
Merged

fix: Remove custom Accept headers from search endpoints#3820
gmlewis merged 1 commit into
google:masterfrom
alexandear-org:fix/search-remove-preview-headers

Conversation

@alexandear

Copy link
Copy Markdown
Contributor

The PR removes deprecated preview "Accept" headers from all search endpoints.

The REST API for search was fully launched a long time ago https://docs.github.com/en/rest/search/search

@alexandear

Copy link
Copy Markdown
ContributorAuthor

We can't remove preview constants yet:

$ grep -r --include='*.go' --exclude='*_test.go''mediaTypeTopicsPreview'../github/repos_forks.go: req.Header.Set("Accept", mediaTypeTopicsPreview)./github/teams.go: req.Header.Set("Accept", mediaTypeTopicsPreview)./github/teams.go: req.Header.Set("Accept", mediaTypeTopicsPreview)./github/activity_star.go: acceptHeaders := []string{mediaTypeStarring, mediaTypeTopicsPreview}./github/repos.go: acceptHeaders := []string{mediaTypeTopicsPreview, mediaTypeRepositoryVisibilityPreview}./github/repos.go: mediaTypeTopicsPreview,./github/repos.go: req.Header.Set("Accept", mediaTypeTopicsPreview)./github/repos.go: req.Header.Set("Accept", mediaTypeTopicsPreview)./github/github.go: mediaTypeTopicsPreview = "application/vnd.github.mercy-preview+json"
$ grep -r --include='*.go' --exclude='*_test.go''mediaTypeReactionsPreview'../github/issues.go: req.Header.Set("Accept", mediaTypeReactionsPreview)./github/issues.go: req.Header.Set("Accept", mediaTypeReactionsPreview)./github/issues.go: req.Header.Set("Accept", mediaTypeReactionsPreview)./github/issues_comments.go: req.Header.Set("Accept", mediaTypeReactionsPreview)./github/issues_comments.go: req.Header.Set("Accept", mediaTypeReactionsPreview)./github/reactions.go: req.Header.Set("Accept", mediaTypeReactionsPreview)./github/reactions.go: req.Header.Set("Accept", mediaTypeReactionsPreview)./github/reactions.go: req.Header.Set("Accept", mediaTypeReactionsPreview)./github/reactions.go: req.Header.Set("Accept", mediaTypeReactionsPreview)./github/reactions.go: req.Header.Set("Accept", mediaTypeReactionsPreview)./github/reactions.go: req.Header.Set("Accept", mediaTypeReactionsPreview)./github/reactions.go: req.Header.Set("Accept", mediaTypeReactionsPreview)./github/reactions.go: req.Header.Set("Accept", mediaTypeReactionsPreview)./github/reactions.go: req.Header.Set("Accept", mediaTypeReactionsPreview)./github/reactions.go: req.Header.Set("Accept", mediaTypeReactionsPreview)./github/reactions.go: req.Header.Set("Accept", mediaTypeReactionsPreview)./github/reactions.go: req.Header.Set("Accept", mediaTypeReactionsPreview)./github/reactions.go: req.Header.Set("Accept", mediaTypeReactionsPreview)./github/reactions.go: req.Header.Set("Accept", mediaTypeReactionsPreview)./github/reactions.go: req.Header.Set("Accept", mediaTypeReactionsPreview)./github/repos_comments.go: req.Header.Set("Accept", mediaTypeReactionsPreview)./github/repos_comments.go: req.Header.Set("Accept", mediaTypeReactionsPreview)./github/repos_comments.go: req.Header.Set("Accept", mediaTypeReactionsPreview)./github/pulls_comments.go: acceptHeaders := []string{mediaTypeReactionsPreview, mediaTypeMultiLineCommentsPreview}./github/pulls_comments.go: acceptHeaders := []string{mediaTypeReactionsPreview, mediaTypeMultiLineCommentsPreview}./github/pulls_comments.go: acceptHeaders := []string{mediaTypeReactionsPreview, mediaTypeMultiLineCommentsPreview}./github/github.go: mediaTypeReactionsPreview = "application/vnd.github.squirrel-girl-preview"

@alexandearalexandear changed the title fix: Remove custom Accept headers in search endpointsfix: Remove custom Accept headers from search endpointsNov 10, 2025
@codecov

codecovBot commented Nov 10, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.32%. Comparing base (9c16433) to head (a068ebe).
⚠️ Report is 3 commits behind head on master.

Additional details and impacted files
@@ Coverage Diff @@## master #3820 +/- ##
==========================================
- Coverage 92.32% 92.32% -0.01% 
==========================================
Files 194 194 Lines 13984 13973 -11 ==========================================
- Hits 12911 12900 -11 
Misses 884 884 Partials 189 189 

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gmlewisgmlewis left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @alexandear!
LGTM.
Awaiting second LGTM+Approval from any other contributor to this repo before merging.

cc: @stevehipwell - @zyfy29

@gmlewisgmlewis added the NeedsReview PR is awaiting a review before merging. label Nov 10, 2025

@stevehipwellstevehipwell left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@gmlewisgmlewis removed the NeedsReview PR is awaiting a review before merging. label Nov 12, 2025
@gmlewis

Copy link
Copy Markdown
Collaborator

Thank you, @stevehipwell!
Merging.

@gmlewis
gmlewis merged commit 3959138 into google:masterNov 12, 2025
7 checks passed
@alexandear
alexandear deleted the fix/search-remove-preview-headers branch November 12, 2025 18:46
alexandear added a commit to alexandear-org/go-github that referenced this pull request Nov 13, 2025
jlaportebot added a commit to jlaportebot/go-github that referenced this pull request Jun 28, 2026
Sign up for freeto 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

@alexandear@gmlewis@stevehipwell