Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

567 B
Raw Blame
import { FILE_URL_REGEX } from '../constants'

describe('upload URL protocol prefix', () => {
  it.each([
    'http://example.com/file.txt',
    'https://example.com/file.pdf',
    'ftp://files.example.com/data.csv',
  ])('accepts a supported remote URL: %s', (url) => expect(FILE_URL_REGEX.test(url)).toBe(true))

  it.each([
    'example.com/file',
    '',
    'file:///local/path',
    'data:text/plain;base64,abc',
    'https:/example.com',
  ])('rejects an unsupported or incomplete prefix: %s', (url) =>
    expect(FILE_URL_REGEX.test(url)).toBe(false),
  )
})