Hi Team,
On publisher, requested url with suffix ( is dynamic which changes with environment so can't be made static ) is being blocked by dispatcher even after adding a rule to allow the request url.
Requested URL : https://domain.com/bin/project/proxy.json/1.1/column/None/()/cms/dev/user
Rules tried :
/1040 { /type "allow" /method '(GET|PUT)' /url "/bin/project/proxy.json*" }
/1040 { /type "allow" /method '(GET|PUT)' /url "/bin/project/api-proxy.json*" /suffix "*" }
Any help will be highly appreciated .
Solved! Go to Solution.
Views
Replies
Total Likes
As I can see it's a path based servlet so it will not work. You will need to convert it into Resource Types based.
As per SLING documentation:
"path-bound servlets can only be registered to a path and not a resource type (i.e. no suffix handling)"
Please see the link below:
https://sling.apache.org/documentation/the-sling-engine/servlets.html#example-registration-by-path-1
Hope this helps!
Thanks!
Hi,
can you try with something like below
/type "allow"
/path "/bin/twitter/api-proxy"
/method '(get|put)'
/extension 'json'
/suffix '*'
Hi Arun,
Thanks for sharing.
I tried the rule which you shared but it gives me 404 error after deployment.
I found the issue is not with the filter rule but when I add RewriteRule with a passthrough to allow the requested URL it works.
/1040 { /type "allow" /method '(GET|PUT)' /url "/bin/project/api-proxy.json*" }
RewriteRule ^/bin/project/api-proxy.json/(.*)$ /bin/project/api-proxy.json/$1 [NC,PT,L]
Yes suffix should work with path bound also.
As I can see it's a path based servlet so it will not work. You will need to convert it into Resource Types based.
As per SLING documentation:
"path-bound servlets can only be registered to a path and not a resource type (i.e. no suffix handling)"
Please see the link below:
https://sling.apache.org/documentation/the-sling-engine/servlets.html#example-registration-by-path-1
Hope this helps!
Thanks!
Thank you !
But using resourceType will not work in my use case . I found the solution using "/bin"path with suffix and it works as expected.
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies