feat: build licensed desktop image processor

This commit is contained in:
2026-08-26 07:26:35 +08:00
parent 6ff3d71921
commit 1f31424015
32 changed files with 6515 additions and 2 deletions
+15
View File
@@ -0,0 +1,15 @@
import { describe, expect, it } from 'vitest'
import { buildDesktopRequestHeaders } from './server-api-headers'
describe('desktop server request headers', () => {
it('builds a Fetch-compatible ASCII client header', () => {
const headers = buildDesktopRequestHeaders('1.0.0')
expect(headers['X-Desktop-Client']).toBe('genuine-qingquwang/1.0.0')
expect(() => new Headers(headers)).not.toThrow()
})
it('rejects non-ASCII version labels before making a request', () => {
expect(() => buildDesktopRequestHeaders('版本-1.0.0')).toThrow(/ASCII/)
})
})