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

HTTP lexer fails on HTTP/2.0 (HTTP/2 works) #1520

Closed
rugk opened this issue Aug 23, 2020 · 5 comments · Fixed by #1521
Closed

HTTP lexer fails on HTTP/2.0 (HTTP/2 works) #1520

rugk opened this issue Aug 23, 2020 · 5 comments · Fixed by #1521

Comments

@rugk
Copy link
Contributor

rugk commented Aug 23, 2020

HTTP/2 defines pseudo-headers with colons:
https://stackoverflow.com/a/38471412/5008962

E.g.

POST /access/sdk/anonymous HTTP/2.0
:authority: example.zendesk.com

{}

in https://pygments.org/demo/#try

results in a bad image

grafik

Also reproduced locally with:

$ pygmentize -V       
Pygments version 2.4.2, (c) 2006-2019 by Georg Brandl.
@rugk
Copy link
Contributor Author

rugk commented Aug 23, 2020

Ohhh no, I now just see it's not (only) the header where it fails, it misses HTTP/2 support altogether, because this works:

POST /access/sdk/anonymous HTTP/1.1
:authority: example.zendesk.com

{}

It only highlights the colon:

POST /access/sdk/anonymous HTTP/1.1
:authority: example.zendesk.com

{}

But this totally fails:

POST /access/sdk/anonymous HTTP/2.0
:authority: example.zendesk.com

{}

@rugk
Copy link
Contributor Author

rugk commented Aug 23, 2020

Oh sorry, just see support has been added in v2.6.1 for this, Sry.

@rugk rugk closed this as completed Aug 23, 2020
@rugk
Copy link
Contributor Author

rugk commented Aug 23, 2020

Though this does not explain why it does not work on https://pygments.org/demo/#try

Also could there be a bug?
If I patched my local version with the this new lexer it did not work, becaaaause…

ah… only HTTP/2 works, but my examples are real-life ones, so I guess you interpret the spec wrong.

@rugk rugk reopened this Aug 23, 2020
@rugk rugk changed the title HTTP lexer fails on HTTP/2 pseudo-headers with a colon (:) HTTP lexer fails on HTTP/2.0 (HTTP/2 works) Aug 23, 2020
@rugk
Copy link
Contributor Author

rugk commented Aug 23, 2020

Okay, opened a PR now: #1521

@rugk
Copy link
Contributor Author

rugk commented Aug 23, 2020

Aaand, as I just notice, the colon issue is still present. Thus opening this as a new issue: #1523

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

Successfully merging a pull request may close this issue.

1 participant