mirror of
https://github.com/tufanbarisyildirim/gonginx.git
synced 2026-04-27 00:35:51 +03:00
[GH-ISSUE #43] mime.types are not recognized properly #21
Labels
No labels
bug
enhancement
good first issue
pull-request
question
v2
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/gonginx#21
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @puzhengwu on GitHub (Mar 14, 2024).
Original GitHub issue: https://github.com/tufanbarisyildirim/gonginx/issues/43
package main
import (
"fmt"
"log"
)
func main() {
p, err := parser.NewParser("/etc/nginx/nginx.conf", parser.WithIncludeParsing())
if err != nil {
log.Fatalln("parser", err)
}
}
unknown directive 'text/html' on line 3, column 5
nginx.conf
#...
include /etc/nginx/mime.types;
#...
mime.types
types {
text/html html htm shtml;
....
@tufanbarisyildirim commented on GitHub (Feb 20, 2026):
Re-checked on current
masterand this is resolved now.I reproduced your case with
parser.NewParser(..., parser.WithIncludeParsing())and an includedmime.typesfile containing:types { text/html ...; }Parsing succeeds (no
unknown directive text/htmlerror).Also verified parser tests pass on current code (
go test ./parser).Closing as fixed in current code. If you still hit this on latest code, please reopen with a minimal repro config and exact version/commit.