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

Single quote ESI tags aren't matched #164

Open
jloh opened this issue Sep 21, 2017 · 2 comments
Open

Single quote ESI tags aren't matched #164

jloh opened this issue Sep 21, 2017 · 2 comments
Labels

Comments

@jloh
Copy link

jloh commented Sep 21, 2017

Unsure whether this is intended or not but ESI tags with single quotes wont match the below.

    local src, err = ngx_re_match(
        include_tag,
        [[src="([^"]+)"]],
        "oj"
    )

https://github.com/pintsized/ledge/blob/adf3372c5c6b6c4d659f13ba2fca40063a2176c9/lib/ledge/esi/processor_1_0.lua#L385-L404

@hamishforbes
Copy link
Collaborator

Yeah the ESI spec doesn't specify but it's XML-based and XML allows for single or double quotes.
So I guess we should support both ideally.

@hamishforbes
Copy link
Collaborator

I think this is true for <esi:when test=""> tags as well.

Perhaps a good solution would be an attribute parsing utility function that can return you a table of attribute / value pairs.
It should handle multiple attributes (something else we don't handle well at the moment) and this single/double quotes issue

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

No branches or pull requests

2 participants