mirror of
https://github.com/langgenius/dify.git
synced 2026-07-21 02:28:30 +08:00
Co-authored-by: 盐粒 Yanli <mail@yanli.one> Co-authored-by: yyh <yuanyouhuilyz@gmail.com> Co-authored-by: Joel <iamjoel007@gmail.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: QuantumGhost <obelisk.reg+git@gmail.com> Co-authored-by: yyh <92089059+lyzno1@users.noreply.github.com> Co-authored-by: 盐粒 Yanli <yanli@dify.ai>
21 lines
792 B
TypeScript
21 lines
792 B
TypeScript
import { describe, expect, it } from 'vitest'
|
|
import { canEmbedPath } from '@/proxy'
|
|
|
|
describe('proxy frame options', () => {
|
|
it('should allow embedded share routes', () => {
|
|
expect(canEmbedPath('/chatbot/token')).toBe(true)
|
|
expect(canEmbedPath('/workflow/token')).toBe(true)
|
|
expect(canEmbedPath('/completion/token')).toBe(true)
|
|
expect(canEmbedPath('/webapp-signin')).toBe(true)
|
|
expect(canEmbedPath('/agent/token')).toBe(true)
|
|
})
|
|
|
|
it('should deny non-embedded console routes by default', () => {
|
|
expect(canEmbedPath('/agents')).toBe(false)
|
|
expect(canEmbedPath('/agent-settings')).toBe(false)
|
|
expect(canEmbedPath('/agentic')).toBe(false)
|
|
expect(canEmbedPath('/agents/agent-1/access')).toBe(false)
|
|
expect(canEmbedPath('/apps')).toBe(false)
|
|
})
|
|
})
|