This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
---@diagnostic disable: undefined-global | |
if vim.g.vscode then | |
return | |
end | |
-- encoding | |
vim.o.encoding = "utf-8" | |
vim.o.fileencoding = "utf-8" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local M = {} | |
local function parse_request_line(line) | |
local method, url, version = line:match("^(%S+)%s+(%S+)%s*(.*)") | |
if not method or not url then | |
return nil, "Invalid HTTP request line format" | |
end | |
if method:upper() ~= "GET" and method:upper() ~= "POST" and method:upper() ~= "PUT" and method:upper() ~= "DELETE" and method:upper() ~= "PATCH" then | |
return nil, "Unsupported HTTP method: " .. method |
OlderNewer