mac
2024-03-21 c270637fca83139eed0735096ce2685694d23ef2
app/src/main/java/com/hdl/photovoltaic/internet/HttpServer/MyNanoHttpServer.java
@@ -25,7 +25,7 @@
public class MyNanoHttpServer extends NanoHTTPD {
    //声明服务端 端口
    public static final Integer HTTP_PORT = 49152;
    public static Integer HTTP_PORT = 49152;// 46219;
    public MyNanoHttpServer(String hostname, int port) {
        super(hostname, port);
@@ -44,6 +44,7 @@
        }
        return myNanoHttpServer;
    }
    @Override
    public Response serve(IHTTPSession session) {
@@ -79,7 +80,7 @@
            String fileName = ((HTTPSession) session).getUri();
            if (!TextUtils.isEmpty(fileName)) {
                if (fileName.contains(HdlFileLogic.getInstance().getDriveRootPath())
                        ||fileName.contains(HdlFileLogic.getInstance().getFirmwareRootPath())) {
                        || fileName.contains(HdlFileLogic.getInstance().getFirmwareRootPath())) {
                    String range = session.getHeaders().get("range");
                    if (TextUtils.isEmpty(range)) {
                        return newFixedLengthResponse("错误,头部没有range字段(-500)");