fix: support sing-box (#36)

This commit is contained in:
PuerNya 2023-08-30 10:55:12 +08:00 committed by GitHub
parent 12e8c9a50b
commit 4eeb3458cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -19,17 +19,15 @@ export default () => {
const { form } = createForm<z.infer<typeof schema>>({ const { form } = createForm<z.infer<typeof schema>>({
extend: validator({ schema }), extend: validator({ schema }),
async onSubmit(values) { async onSubmit(values) {
const { hello } = await ky const { ok } = await ky.get(values.url, {
.get(values.url, { headers: values.secret
headers: values.secret ? {
? { Authorization: `Bearer ${values.secret}`,
Authorization: `Bearer ${values.secret}`, }
} : {},
: {}, })
})
.json<{ hello: string }>()
if (!hello) { if (!ok) {
return return
} }