1
0
mirror of synced 2026-01-08 12:01:53 -05:00

Merge pull request #25704 from github/repo-sync

repo sync
This commit is contained in:
Octomerger Bot
2023-05-25 12:36:08 -04:00
committed by GitHub
4 changed files with 17 additions and 6 deletions

View File

@@ -15,7 +15,6 @@ import { ArticleGridLayout } from './ArticleGridLayout'
import { PlatformPicker } from 'components/article/PlatformPicker'
import { ToolPicker } from 'components/article/ToolPicker'
import { MiniTocs } from 'components/ui/MiniTocs'
import { ClientSideHighlight } from 'components/ClientSideHighlight'
import { LearningTrackCard } from 'components/article/LearningTrackCard'
import { RestRedirect } from 'src/rest/components/RestRedirect'
import { Breadcrumbs } from 'components/page-header/Breadcrumbs'
@@ -51,7 +50,6 @@ export const ArticlePage = () => {
<DefaultLayout>
<LinkPreviewPopover />
{isDev && <ClientSideRefresh />}
<ClientSideHighlight />
{router.pathname.includes('/rest/') && <RestRedirect />}
<div className="container-xl px-3 px-md-6 my-4">
<div className={cx('d-none d-xl-block mt-3 mr-auto width-full')}>

View File

@@ -17,6 +17,14 @@ const MAP = {
contentType: 'image/png',
buffer: getBuffer('assets/images/site/apple-touch-icon.png'),
},
// It's the same image but it's fine. By default, when Safari tries to
// to figure out which apple touch icons are available it will
// try to load this by default. For example, if you in desktop Safari
// click share icon, it will load this to serve as a preview icon.
'/apple-touch-icon-precomposed.png': {
contentType: 'image/png',
buffer: getBuffer('assets/images/site/apple-touch-icon.png'),
},
}
function getBuffer(filePath) {

View File

@@ -7,7 +7,6 @@ import { PermissionsStatement } from 'components/ui/PermissionsStatement'
import { RestOperation } from './RestOperation'
import { useAutomatedPageContext } from 'components/context/AutomatedPageContext'
import { Operation } from './types'
import { ClientSideHighlight } from 'components/ClientSideHighlight'
import { ClientSideRedirects } from 'src/rest/components/ClientSideRedirects'
import { RestRedirect } from 'src/rest/components/RestRedirect'
@@ -40,7 +39,6 @@ export const RestReferencePage = ({ restOperations }: StructuredContentT) => {
{/* Doesn't matter *where* this is included because it will
never render anything. It always just return null. */}
<ClientSideRedirects />
<ClientSideHighlight />
<RestRedirect />
<div className="px-3 px-md-6 my-4 container-xl" data-search="article-body">
<h1 id="title-h1" className="mb-3">

View File

@@ -6,7 +6,7 @@ import { get } from '../helpers/e2etest.js'
describe('favicon assets', () => {
jest.setTimeout(60 * 1000)
it('should serve a valid and aggressively caching /favicon.ico', async () => {
test('should serve a valid and aggressively caching /favicon.ico', async () => {
const res = await get('/favicon.ico')
expect(res.statusCode).toBe(200)
expect(parseInt(res.headers['content-length'], 10)).toBeGreaterThan(0)
@@ -21,7 +21,8 @@ describe('favicon assets', () => {
expect(maxAgeSeconds).toBeGreaterThanOrEqual(60 * 60)
expect(res.headers['surrogate-key']).toBe(SURROGATE_ENUMS.MANUAL)
})
it('should serve a valid and aggressively caching /apple-touch-icon.png', async () => {
test('should serve a valid and aggressively caching /apple-touch-icon.png', async () => {
const res = await get('/apple-touch-icon.png')
expect(res.statusCode).toBe(200)
expect(parseInt(res.headers['content-length'], 10)).toBeGreaterThan(0)
@@ -36,4 +37,10 @@ describe('favicon assets', () => {
expect(maxAgeSeconds).toBeGreaterThanOrEqual(60 * 60)
expect(res.headers['surrogate-key']).toBe(SURROGATE_ENUMS.MANUAL)
})
test('should also 200 OK on /apple-touch-icon-precomposed.png', async () => {
const res = await get('/apple-touch-icon-precomposed.png')
expect(res.statusCode).toBe(200)
expect(res.headers['content-type']).toBe('image/png')
})
})