Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: space character problem when parsing content-type #310

Merged
merged 1 commit into from
Nov 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lua/kulala/internal_processing/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ local FS = require("kulala.utils.fs")
local GLOBALS = require("kulala.globals")
local DB = require("kulala.db")
local CONFIG = require("kulala.config")
local STRING_UTILS = require("kulala.utils.string")
local M = {}

-- Function to access a nested key in a table dynamically
Expand Down Expand Up @@ -111,6 +112,7 @@ M.get_config_contenttype = function()
local headers = get_lower_headers_as_table()
if headers["content-type"] then
local content_type = vim.split(headers["content-type"], ";")[1]
content_type = STRING_UTILS.trim(content_type)
local config = CONFIG.get().contenttypes[content_type]
if config then
return config
Expand Down