fix(sub): tolerate a hysteria inbound without hysteriaSettings in the JSON subscription

genHy asserted stream["hysteriaSettings"].(map[string]any) without the comma-ok
form, so a hysteria inbound whose StreamSettings omit the hysteriaSettings key
(a valid, representable shape the raw generator renders fine) panicked and 500ed
the entire JSON subscription. Use comma-ok; the downstream reads already guard
each key, so a nil map degrades gracefully.
This commit is contained in:
MHSanaei
2026-07-15 02:39:40 +02:00
parent abab7cd000
commit fa4ac3100d
2 changed files with 41 additions and 1 deletions
+1 -1
View File
@@ -496,7 +496,7 @@ func (s *SubJsonService) genHy(inbound *model.Inbound, newStream map[string]any,
}
_ = json.Unmarshal([]byte(inbound.StreamSettings), &stream)
hyStream := stream["hysteriaSettings"].(map[string]any)
hyStream, _ := stream["hysteriaSettings"].(map[string]any)
outHyStream := map[string]any{
"version": int(version),
"auth": client.Auth,