fix: admin and docs bugs
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
c654ff9f73
commit
8be71e9929
@@ -913,23 +913,25 @@ const registrationTest = `{
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Test endpoints -->
|
<!-- Test endpoints -->
|
||||||
<div v-if="docs"
|
<template v-if="docs">
|
||||||
v-for="(test, key) in docs.testing"
|
<div
|
||||||
:key="key"
|
v-for="(test, key) in docs.testing"
|
||||||
class="border-2 border-border bg-surface p-5"
|
:key="key"
|
||||||
>
|
class="border-2 border-border bg-surface p-5"
|
||||||
<div class="flex items-center gap-2 mb-2">
|
>
|
||||||
<span class="px-2 py-0.5 text-[9px] font-display font-bold uppercase tracking-wider border border-neon-cyan/40 text-neon-cyan">
|
<div class="flex items-center gap-2 mb-2">
|
||||||
{{ (test as any).method }}
|
<span class="px-2 py-0.5 text-[9px] font-display font-bold uppercase tracking-wider border border-neon-cyan/40 text-neon-cyan">
|
||||||
</span>
|
{{ (test as any).method }}
|
||||||
<span class="font-mono text-xs text-neon-pink">
|
</span>
|
||||||
{{ (test as any).path }}
|
<span class="font-mono text-xs text-neon-pink">
|
||||||
</span>
|
{{ (test as any).path }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<p class="font-mono text-text-secondary text-xs">
|
||||||
|
{{ (test as any).description }}
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<p class="font-mono text-text-secondary text-xs">
|
</template>
|
||||||
{{ (test as any).description }}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Tips -->
|
<!-- Tips -->
|
||||||
<div v-if="docs" class="border-2 border-neon-cyan/20 bg-neon-cyan/5 p-5">
|
<div v-if="docs" class="border-2 border-neon-cyan/20 bg-neon-cyan/5 p-5">
|
||||||
|
|||||||
@@ -172,7 +172,7 @@ docsRouter.post('/test', async (c) => {
|
|||||||
return c.json({ error: 'Missing "url" field' }, 400)
|
return c.json({ error: 'Missing "url" field' }, 400)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Basic URL validation — must be https, no private IPs
|
// Basic URL validation — must be http(s), no private IPs
|
||||||
let parsed: URL
|
let parsed: URL
|
||||||
try {
|
try {
|
||||||
parsed = new URL(url)
|
parsed = new URL(url)
|
||||||
@@ -180,7 +180,7 @@ docsRouter.post('/test', async (c) => {
|
|||||||
return c.json({ error: 'Invalid URL' }, 400)
|
return c.json({ error: 'Invalid URL' }, 400)
|
||||||
}
|
}
|
||||||
if (parsed.protocol !== 'https:' && parsed.protocol !== 'http:') {
|
if (parsed.protocol !== 'https:' && parsed.protocol !== 'http:') {
|
||||||
return c.json({ error: 'URL must use https://' }, 400)
|
return c.json({ error: 'URL must use http:// or https://' }, 400)
|
||||||
}
|
}
|
||||||
const host = parsed.hostname
|
const host = parsed.hostname
|
||||||
if (host === 'localhost' || host === '127.0.0.1' || host.startsWith('192.168.') || host.startsWith('10.') || host.endsWith('.local')) {
|
if (host === 'localhost' || host === '127.0.0.1' || host.startsWith('192.168.') || host.startsWith('10.') || host.endsWith('.local')) {
|
||||||
|
|||||||
Reference in New Issue
Block a user