Skip to content

Plugin ordering changes remap URI even with empty plugin #4026

@ezelkow1

Description

@ezelkow1

While testing some things with cachekey I noticed that I was getting some odd results. If cachekey is the very first plugin listed in a remap then it gets the pristine url, however if it is not first then it will get the remapped url. We put in an empty header rewrite just to test this.

My curl:
curl 'http://localhost:8080/index.html' -vlsk -H 'Host: edge.invalid' -H 'X-Debug: X-Cache-key'

Produces expected result:
< X-Cache-Key: https://google.com/index.html

map / https://google.com/ @plugin=header_rewrite.so @pparam=/home/%USERNAME/empty @plugin=cachekey.so @pparam=--separator= @pparam=--remove-all-params=true @pparam=--remove-path=true @pparam=--capture-prefix-uri=/^([^?]*)/$1/

Non-expected:
< X-Cache-Key: http://edge.invalid/index.html

map / https://google.com/ @plugin=cachekey.so @pparam=--separator= @pparam=--remove-all-params=true @pparam=--remove-path=true @pparam=--capture-prefix-uri=/^([^?]*)/$1/

It would seem to me that we would want the first url, the one already remapped, to be what every plugin sees. In that case I have just used a header_rewrite with a touched empty file. This was seen on my own test build based on 7.1.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions