@@ -266,7 +266,7 @@ func SetBlockListFromFile() bool {
266
266
267
267
var content []string
268
268
if filepath .Ext (filePath ) == ".json" {
269
- err = json .Unmarshal (blockListContent , & content )
269
+ err = json .Unmarshal (jsonc . ToJSON ( blockListContent ) , & content )
270
270
if err != nil {
271
271
Log ("SetBlockListFromFile" , GetLangText ("Error-GenJSONWithID" ), true , filePath , err .Error ())
272
272
continue
@@ -305,7 +305,7 @@ func SetBlockListFromURL() bool {
305
305
306
306
var content []string
307
307
if strings .HasSuffix (strings .ToLower (strings .Split (httpHeader .Get ("Content-Type" ), ";" )[0 ]), "json" ) {
308
- err := json .Unmarshal (blockListContent , & content )
308
+ err := json .Unmarshal (jsonc . ToJSON ( blockListContent ) , & content )
309
309
if err != nil {
310
310
Log ("SetBlockListFromFile" , GetLangText ("Error-GenJSONWithID" ), true , blockListURL , err .Error ())
311
311
continue
@@ -380,7 +380,7 @@ func SetIPBlockListFromFile() bool {
380
380
381
381
var content []string
382
382
if filepath .Ext (filePath ) == ".json" {
383
- err := json .Unmarshal (ipBlockListFile , & content )
383
+ err := json .Unmarshal (jsonc . ToJSON ( ipBlockListFile ) , & content )
384
384
if err != nil {
385
385
Log ("SetIPBlockListFromFile" , GetLangText ("Error-GenJSONWithID" ), true , filePath , err .Error ())
386
386
}
@@ -416,7 +416,7 @@ func SetIPBlockListFromURL() bool {
416
416
417
417
var content []string
418
418
if strings .HasSuffix (httpHeader .Get ("Content-Type" ), "json" ) {
419
- err := json .Unmarshal (ipBlockListContent , & content )
419
+ err := json .Unmarshal (jsonc . ToJSON ( ipBlockListContent ) , & content )
420
420
if err != nil {
421
421
Log ("SetIPBlockListFromURL" , GetLangText ("Error-GenJSONWithID" ), true , ipBlockListURL , err .Error ())
422
422
continue
0 commit comments