CloudFront invalidation paths should not be encoded
firstcloudconsulting opened this issue · comments
Automatic encoding of the CloudFront invalidation paths prevents the possibility of invalidating paths that contain query strings, e.g. "/some/path/?lang=en" becomes "/some/path/%3Flang%3Den".
I am currently overriding this by extending InvalidationBatch in my own models.py and stripping the call to encode each path in InvalidationBatch.to_xml(). If I then pass my custom InvalidationBatch object to create_invalidation_request() then it will pass the unencoded paths to CloudFront as desired.
The encoding in to_xml() is the problem and should likely be stripped. If not, then this should at least be an option as an additional parameter (preferable defaulting to False).