@rip-lang/server 1.1.9 → 1.1.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/server.rip +5 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rip-lang/server",
3
- "version": "1.1.9",
3
+ "version": "1.1.10",
4
4
  "description": "Pure Rip application server — multi-worker, hot reload, HTTPS, mDNS",
5
5
  "type": "module",
6
6
  "main": "server.rip",
package/server.rip CHANGED
@@ -817,11 +817,14 @@ class Server
817
817
 
818
818
  return @status() if url.pathname is '/status'
819
819
 
820
- # SSE hot-reload: intercept /{prefix}/watch for registered watch groups
820
+ # SSE hot-reload: intercept /{prefix}/watch
821
821
  path = url.pathname
822
822
  if path.endsWith('/watch')
823
823
  watchPrefix = path.slice(0, -6) # strip '/watch'
824
- return @handleWatch(watchPrefix) if @watchGroups.has(watchPrefix)
824
+ if @watchGroups.has(watchPrefix)
825
+ return @handleWatch(watchPrefix)
826
+ else
827
+ return new Response('', { status: 503, headers: { 'Retry-After': '2' } })
825
828
 
826
829
  if url.pathname is '/server'
827
830
  headers = new Headers({ 'content-type': 'text/plain' })