We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
site.xml:
site.xml
<mappings> <mapping filter="/site/mappings/filter.js"> <pattern>/filter</pattern> </mapping> </mappings> </site>
/site/mappings/filter.js:
/site/mappings/filter.js
exports.filter = function (req, next) { log.info(JSON.stringify(req.params, null, 4)); return next(req); };
A part added to the default site's template:
exports.get = function (req, next) { log.info(JSON.stringify(req.params, null, 4)); return { contentType: 'text/html', body: body }; };
This setup will output the following in the XP log for url http://localhost:8080/admin/site/preview/default/draft/features/filter?q=1:
http://localhost:8080/admin/site/preview/default/draft/features/filter?q=1
16:18:35.280 INFO com.enonic.app.features - (/site/mappings/filter.js) { "q": "1" } 16:18:35.289 INFO com.enonic.app.features - (/site/parts/my-part/my-part.js) { "q": [ "1", "1" ] }
After going through the filter, q parameter becomes an array with duplicated value.
q
The text was updated successfully, but these errors were encountered:
It appeared after #8210 (although, it is not a regression)
Interestingly enough we are not the first who face such issue jetty/jetty.project#2074
Sorry, something went wrong.
Filter causes duplication of query parameters #9100
b852e98
prams from filter result are appended to params with the same name - that is causing bug in cases where filter uses next as a return value.
next
To do a fix we decided to changes the behavior: prams with the same name in filter result replace params in the original request.
de8acd5
1633df4
rymsha
No branches or pull requests
site.xml
:/site/mappings/filter.js
:A part added to the default site's template:
This setup will output the following in the XP log for url
http://localhost:8080/admin/site/preview/default/draft/features/filter?q=1
:After going through the filter,
q
parameter becomes an array with duplicated value.The text was updated successfully, but these errors were encountered: