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

unknown directive 'application/octet-stream' #44

Open
ghost opened this issue Mar 23, 2024 · 3 comments
Open

unknown directive 'application/octet-stream' #44

ghost opened this issue Mar 23, 2024 · 3 comments

Comments

@ghost
Copy link

ghost commented Mar 23, 2024

Hello,

When I add this into the nginx configuration in server block, the parser gives me unknown directive error:

    types {
        application/octet-stream mp4;
        application/octet-stream srt;
        application/octet-stream ass;
    }

exact error message: unknown directive 'application/octet-stream' on line 10, column 9

Is there anyway to skip this or even better make it parse this?

Thank you in advance.

@ghost
Copy link
Author

ghost commented Mar 23, 2024

As a workaround I did put them in a file and included them in the config.

@mofantor
Copy link
Contributor

You can use parser.WithSkipValidDirectivesErr to skip syntax checks, as in the following code snippet: parser.NewParser(filePath, parser.WithSkipValidDirectivesErr())

@ghost
Copy link
Author

ghost commented Apr 1, 2024

You can use parser.WithSkipValidDirectivesErr to skip syntax checks, as in the following code snippet: parser.NewParser(filePath, parser.WithSkipValidDirectivesErr())

Shouldn't these be parsed? I mean I got issues with this and using variables in server blocks, I eventually switched to crossplane and parsed the whole nginx file then got my needed directive arguments but this would be very better as crossplane parsed whole nginx file instead of individual files.

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

No branches or pull requests

1 participant