Skip to content
This repository has been archived by the owner on Apr 9, 2023. It is now read-only.

Detecting application/json #1

Open
dbrgn opened this issue Apr 20, 2017 · 4 comments
Open

Detecting application/json #1

dbrgn opened this issue Apr 20, 2017 · 4 comments

Comments

@dbrgn
Copy link

dbrgn commented Apr 20, 2017

Currently JSON files do not seem to be detected properly, but instead detected as application/json. Is this planned, or out of scope?

@aahancoc
Copy link
Owner

I assume you're wanting it detected as text/json or the sort. It seems from reading around (see http://stackoverflow.com/q/477816) that application/json is the way to go for json filetypes. If you want to compare against something else, you should be able to use the match_* functions which should handle aliases like text/json or the like.

@dbrgn
Copy link
Author

dbrgn commented Apr 23, 2017

Uh, sorry, yeah, I meant to write text/plain. And yes, application/json would be correct.

There are also others, e.g. YAML files are usually specified as text/yaml.

@aahancoc
Copy link
Owner

Alright, got you. I just haven't gotten around to implementing that yet. Will soon, but I'm busy with schoolwork right now.

@rustonaut
Copy link

There is also the problem that any valid json file is also a valid yaml and a valid toml file.

For many textual formats there is no good way to differentiate them except heuristics.
(like any php .init is a differen but similar format as py .property files which can be
equivalent to an toml file)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants