mirror of
https://github.com/langgenius/dify.git
synced 2025-12-05 23:36:09 +00:00
fix: remove deprecated UnsafeUnwrappedHeaders usage (#28219)
Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
parent
a6cd2ad880
commit
82c11e36ea
@ -1,7 +1,7 @@
|
|||||||
import type { FC } from 'react'
|
import type { FC } from 'react'
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import Script from 'next/script'
|
import Script from 'next/script'
|
||||||
import { type UnsafeUnwrappedHeaders, headers } from 'next/headers'
|
import { headers } from 'next/headers'
|
||||||
import { IS_CE_EDITION } from '@/config'
|
import { IS_CE_EDITION } from '@/config'
|
||||||
|
|
||||||
export enum GaType {
|
export enum GaType {
|
||||||
@ -18,13 +18,13 @@ export type IGAProps = {
|
|||||||
gaType: GaType
|
gaType: GaType
|
||||||
}
|
}
|
||||||
|
|
||||||
const GA: FC<IGAProps> = ({
|
const GA: FC<IGAProps> = async ({
|
||||||
gaType,
|
gaType,
|
||||||
}) => {
|
}) => {
|
||||||
if (IS_CE_EDITION)
|
if (IS_CE_EDITION)
|
||||||
return null
|
return null
|
||||||
|
|
||||||
const nonce = process.env.NODE_ENV === 'production' ? (headers() as unknown as UnsafeUnwrappedHeaders).get('x-nonce') ?? '' : ''
|
const nonce = process.env.NODE_ENV === 'production' ? (await headers()).get('x-nonce') ?? '' : ''
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|||||||
@ -1,13 +1,13 @@
|
|||||||
import { memo } from 'react'
|
import { memo } from 'react'
|
||||||
import { type UnsafeUnwrappedHeaders, headers } from 'next/headers'
|
import { headers } from 'next/headers'
|
||||||
import Script from 'next/script'
|
import Script from 'next/script'
|
||||||
import { IS_CE_EDITION, ZENDESK_WIDGET_KEY } from '@/config'
|
import { IS_CE_EDITION, ZENDESK_WIDGET_KEY } from '@/config'
|
||||||
|
|
||||||
const Zendesk = () => {
|
const Zendesk = async () => {
|
||||||
if (IS_CE_EDITION || !ZENDESK_WIDGET_KEY)
|
if (IS_CE_EDITION || !ZENDESK_WIDGET_KEY)
|
||||||
return null
|
return null
|
||||||
|
|
||||||
const nonce = process.env.NODE_ENV === 'production' ? (headers() as unknown as UnsafeUnwrappedHeaders).get('x-nonce') ?? '' : ''
|
const nonce = process.env.NODE_ENV === 'production' ? (await headers()).get('x-nonce') ?? '' : ''
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user