fixing incident #31057
This commit is contained in:
parent
6b6ad2d47c
commit
721b6f1732
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -84,8 +84,12 @@
|
|||
|
||||
|
||||
|
||||
<wb-module deploy-name="uri-resolver-2.10.2">
|
||||
|
||||
|
||||
|
||||
<wb-module deploy-name="uri-resolver-2.10.3-SNAPSHOT">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -171,7 +175,9 @@
|
|||
|
||||
|
||||
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -257,7 +263,9 @@
|
|||
|
||||
|
||||
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -343,7 +351,9 @@
|
|||
|
||||
|
||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -429,8 +439,12 @@
|
|||
|
||||
|
||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
|
||||
|
||||
|
||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/target/generated-sources/annotations"/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -516,14 +530,18 @@
|
|||
|
||||
|
||||
<property name="context-root" value="uri-resolver"/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<property name="java-output-path" value="/uri-resolver/target/classes"/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -609,7 +627,9 @@
|
|||
|
||||
|
||||
</wb-module>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,10 @@
|
|||
All notable changes to this project will be documented in this file.
|
||||
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [v2.10.3-SNAPSHOT]
|
||||
|
||||
- Fixed Incident [#31057]
|
||||
|
||||
## [v2.10.2]
|
||||
|
||||
- Migrated to Shlink service [#30388]
|
||||
|
|
|
|||
2
pom.xml
2
pom.xml
|
|
@ -9,7 +9,7 @@
|
|||
</parent>
|
||||
<groupId>org.gcube.data.transfer</groupId>
|
||||
<artifactId>uri-resolver</artifactId>
|
||||
<version>2.10.2</version>
|
||||
<version>2.10.3-SNAPSHOT</version>
|
||||
<packaging>war</packaging>
|
||||
<description>The URI Resolver is an HTTP URI resolver implemented as a REST
|
||||
service which gives access trough HTTP to different gcube Resolvers and
|
||||
|
|
|
|||
|
|
@ -79,7 +79,8 @@ public class CatalogueStaticConfigurations{
|
|||
* @param privateCKANCatalogueURL the private CKAN catalogue URL
|
||||
* @return the catalogue name
|
||||
*
|
||||
* e.g. Returns "-bb" for "ckan-bb"
|
||||
* e.g. Returns "-bb" for "ckan-bb" if is a subdomain of "d4science",
|
||||
* but returns null if the URL is not in the expected format.
|
||||
*/
|
||||
private String extractCatalogueName(String privateCKANCatalogueURL) {
|
||||
|
||||
|
|
@ -93,7 +94,12 @@ public class CatalogueStaticConfigurations{
|
|||
LOG.trace(prefix+ " found as prefix of: "+privateCKANCatalogueURL);
|
||||
if(toPrivateCKANCatalogueURL.startsWith(prefix)) {
|
||||
toPrivateCKANCatalogueURL = toPrivateCKANCatalogueURL.replaceFirst(prefix, ""); //removing prefix
|
||||
String catalogueName = toPrivateCKANCatalogueURL.substring(0,toPrivateCKANCatalogueURL.indexOf(".d4science"));
|
||||
int d4scienceIndex = toPrivateCKANCatalogueURL.indexOf(".d4science");
|
||||
if(d4scienceIndex < 0) {
|
||||
LOG.warn("Cannot extract catalogue name: '.d4science' not found in URL after removing prefix '{}'. URL was: {}", prefix, privateCKANCatalogueURL);
|
||||
return null;
|
||||
}
|
||||
String catalogueName = toPrivateCKANCatalogueURL.substring(0, d4scienceIndex);
|
||||
LOG.info("Catalogue Name extraction returning value: "+catalogueName);
|
||||
return catalogueName;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue