Skip to content
Snippets Groups Projects
Commit edf9d822 authored by Yauheni Lesnikau's avatar Yauheni Lesnikau Committed by Devin Kelley
Browse files

fix the AKS issue related to the encoded slash(%2F) into the URL

parent 7fda1049
No related branches found
No related tags found
1 merge request!392fix the AKS issue related to the encoded slash(%2F) into the URL
package org.opengroup.osdu.unitservice;
import org.apache.tomcat.util.buf.EncodedSolidusHandling;
import org.opengroup.osdu.unitservice.model.CatalogImpl;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
import org.springframework.boot.web.server.WebServerFactoryCustomizer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
......@@ -25,4 +28,10 @@ public class UnitAksConfiguration {
return CatalogImpl.createCatalog(reader);
}
}
@Bean
public WebServerFactoryCustomizer<TomcatServletWebServerFactory> tomcatCustomizer() {
logger.info("Configuring Tomcat to allow encoded slashes.");
return factory -> factory.addConnectorCustomizers(connector -> connector.setEncodedSolidusHandling(EncodedSolidusHandling.DECODE.getValue()));
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment