Skip to content

Commit 103b67c

Browse files
authored
Add comment to keep API preview headers around for GitHub Enterprise users (#2188)
1 parent 8ad980b commit 103b67c

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

github/github.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,21 @@ const (
4848
mediaTypeIssueImportAPI = "application/vnd.github.golden-comet-preview+json"
4949

5050
// Media Type values to access preview APIs
51+
// These media types will be added to the API request as headers
52+
// and used to enable particular features on GitHub API that are still in preview.
53+
// After some time, specific media types will be promoted (to a "stable" state).
54+
// From then on, the preview headers are not required anymore to activate the additional
55+
// feature on GitHub.com's API. However, this API header might still be needed for users
56+
// to run a GitHub Enterprise Server on-premise.
57+
// It's not uncommon for GitHub Enterprise Server customers to run older versions which
58+
// would probably rely on the preview headers for some time.
59+
// While the header promotion is going out for GitHub.com, it may be some time before it
60+
// even arrives in GitHub Enterprise Server.
61+
// We keep those preview headers around to avoid breaking older GitHub Enterprise Server
62+
// versions. Additionally, non-functional (preview) headers don't create any side effects
63+
// on GitHub Cloud version.
64+
//
65+
// See https://github.com/google/go-github/pull/2125 for full context.
5166

5267
// https://developer.github.com/changes/2014-12-09-new-attributes-for-stars-api/
5368
mediaTypeStarringPreview = "application/vnd.github.v3.star+json"

0 commit comments

Comments
 (0)