(url: URL, opts: any = {})
| 39 | }; |
| 40 | |
| 41 | function phpFetch(url: URL, opts: any = {}) { |
| 42 | const spec = opts.ccall( |
| 43 | "phpw_exec", |
| 44 | STR, |
| 45 | [STR], |
| 46 | [getRequestCode(url, opts)] |
| 47 | ) as string; |
| 48 | |
| 49 | if (!spec) { |
| 50 | throw new Error("PHP call did not return anything."); |
| 51 | } |
| 52 | |
| 53 | const parts = spec.split("\r\n\r\n"); |
| 54 | const head = parseHeaders(parts[0]) as any; |
| 55 | const body = parts[1]; |
| 56 | |
| 57 | return new Response(body, { |
| 58 | status: head.statusCode, |
| 59 | statusText: head.statusMessage, |
| 60 | headers: new Headers(head.headers), |
| 61 | }); |
| 62 | } |
| 63 | |
| 64 | function SwaggerUIReact(props: any) { |
| 65 | const ui = SwaggerUIConstructor(props) as any; |
no test coverage detected