-
Improvement
-
Resolution: Fixed
-
Major
-
None
-
None
-
4.10 M6
If it includes a final /, the following errors are encountered :
An error occurred requesting Matomo for url 'https://intrastats.xxx.fr//?module=API&method=Live.getLastVisitsDetails&format=JSON&period=day&date=today&idSite=17&token_auth=1659d58df383039e906cd3bfced15313' at org.ametys.plugins.webanalytics.matomo.MatomoDataHelper#_executeMatomoRequest:441 at org.ametys.plugins.webanalytics.matomo.MatomoDataHelper#_requestLiveVisitsOfDay:243 at org.ametys.plugins.webanalytics.matomo.MatomoDataHelper#lambda$_getLiveVisitsOfDay$0:220 at org.ametys.core.util.LambdaUtils#lambda$wrap$0:71 ... 102 more Caused by: java.lang.IllegalArgumentException: URI path begins with multiple slashes at org.apache.hc.core5.util.Args#check:41 at org.apache.hc.core5.http.message.BasicHttpRequest#setUri:281 at org.apache.hc.core5.http.message.BasicHttpRequest#<init>:123 at org.apache.hc.core5.http.message.BasicClassicHttpRequest#<init>:91 at org.apache.hc.client5.http.classic.methods.HttpUriRequestBase#<init>:45 at org.apache.hc.client5.http.classic.methods.HttpPost#<init>:50 at org.apache.hc.client5.http.classic.methods.HttpPost#<init>:60 at org.ametys.plugins.webanalytics.matomo.MatomoDataHelper#_executeMatomoRequest:420
It would be useful to add a regex to prevent the possibility of entering the / as in the cms.url parameter.
<param type="string" id="cms.url">
<label i18n="true">PLUGINS_CMS_CONFIG_CMS_URL_LABEL</label>
<description i18n="true">PLUGINS_CMS_CONFIG_CMS_URL_DESCRIPTION</description>
<validation>
<mandatory/>
<regexp>^https?:\/\/[^\s?;#]+(?<!\/)$</regexp>
<invalidText i18n="true">plugin.core:PLUGINS_CORE_REGEXP_INVALID_HTTP_URL</invalidText>
</validation>
....
</param>