🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@cantoo/capacitor-http-server

Package Overview
Dependencies
Maintainers
5
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cantoo/capacitor-http-server - npm Package Compare versions

Comparing version
1.0.2
to
1.0.3
+13
-3
android/src/main/j...ooscribe/httpserver/HttpServerPlugin.kt

@@ -137,3 +137,8 @@ package com.cantooscribe.httpserver

} catch (e: Throwable) {
call.reject("Failed to start server: ${e.message}", e)
// PluginCall.reject(String, Exception) cannot accept a raw
// Throwable, so wrap errors (OOM, etc.) in an Exception.
call.reject(
"Failed to start server: ${e.message}",
e as? Exception ?: RuntimeException(e)
)
return

@@ -179,3 +184,6 @@ }

try { srv?.stop() } catch (_: Throwable) {}
call.reject("Failed to start foreground service: ${e.message}", e)
call.reject(
"Failed to start foreground service: ${e.message}",
e as? Exception ?: RuntimeException(e)
)
return

@@ -471,4 +479,6 @@ }

entry?.tempFile?.let { runCatching { it.delete() } }
// NanoHTTPD 2.3.1 does not expose 504 in Response.Status,
// so build a custom IStatus via HttpRequestBridge.statusOf.
return newFixedLengthResponse(
Response.Status.GATEWAY_TIMEOUT,
HttpRequestBridge.statusOf(504),
"text/plain",

@@ -475,0 +485,0 @@ "JS handler did not respond in time"

+1
-1
{
"name": "@cantoo/capacitor-http-server",
"version": "1.0.2",
"version": "1.0.3",
"description": "Capacitor plugin exposing a local HTTP server on iOS and Android with routing delegated to JavaScript.",

@@ -5,0 +5,0 @@ "main": "dist/plugin.cjs.js",