diag: add example.com connectivity probe (PROBE_RESULT) to determine if Figma sandbox has internet egress; bump 0.1.11
This commit is contained in:
1 parent
7307fa6c76
commit
0f7005e4b1
5 files changed
+20
-4
No files matched your search
@@ -511,6 +511,13 @@ export default function () {
|
||||
emit('MODELS_RESULT', { ok: false, error: 'fetch is not available in the plugin main thread', models: [], status: 0, requestEcho: echo })
|
||||
return
|
||||
}
|
||||
// diagnostic: can the sandbox reach the public internet at all?
|
||||
try {
|
||||
const pr = await fetch('https://example.com')
|
||||
emit('PROBE_RESULT', { msg: 'example.com reachable · status=' + pr.status })
|
||||
} catch (pe) {
|
||||
emit('PROBE_RESULT', { msg: 'example.com UNREACHABLE · ' + (pe != null ? (typeof pe === 'string' ? pe : JSON.stringify(pe)) : 'unknown') })
|
||||
}
|
||||
const base = payload.baseUrl.replace(/\/+$/, '')
|
||||
const res = await fetch(base + '/models', {
|
||||
headers: { Authorization: 'Bearer ' + payload.apiKey }
|
||||
|
||||
Reference in new issue
Block a user