MetaCubeX / mihomo

A simple Python Pydantic model for Honkai: Star Rail parsed data from the Mihomo API.
https://wiki.metacubex.one
MIT License
16.79k stars 2.66k forks source link

[Bug] rule-provider文件只有一行时,解析报错 #1349

Closed morytyann closed 4 months ago

morytyann commented 4 months ago

Verify steps

Operating System

Linux

System Version

OpenWrt 23.05

Mihomo Version

1.18.5

Configuration File

rule-providers:
  MyDirect:
    type: http
    url: https://example.com/MyDirect.txt
    behavior: domain
    format: text

Description

如果https://example.com/MyDirect.txt只有一行时,启动会报错

Reproduction Steps

  1. 添加rule-provider配置,指向一个内容只有一行的文件/URL
  2. 启动

Logs

initial rule provider MyDirect error: file must have a `payload` field
xishang0128 commented 4 months ago

@morytyann 只有一行就不要用ruleset了,没意义

morytyann commented 4 months ago

@xishang0128 那在文档里加一个ruleset必须大于一行?

xishang0128 commented 4 months ago

@morytyann 处理了,等会用新的alpha就好了

morytyann commented 4 months ago

感谢