Skip to content

Commit

Permalink
Merge pull request #60 from GIScience/fix-pipe-sign
Browse files Browse the repository at this point in the history
allowing pipe sign in GET requests
  • Loading branch information
FabiKo117 committed Oct 14, 2020
1 parent f9cd5f7 commit efe6599
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/main/java/org/heigit/ohsome/ohsomeapi/config/TomcatConfig.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package org.heigit.ohsome.ohsomeapi.config;

import org.apache.catalina.connector.Connector;
import org.springframework.boot.web.embedded.tomcat.TomcatConnectorCustomizer;
import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
import org.springframework.boot.web.servlet.server.ConfigurableServletWebServerFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/** Used to allow the not encoded pipe sign (|) in request URLs. */
@Configuration
public class TomcatConfig {

@Bean
public ConfigurableServletWebServerFactory webServerFactory() {
TomcatServletWebServerFactory factory = new TomcatServletWebServerFactory();
factory.addConnectorCustomizers(new TomcatConnectorCustomizer() {
@Override
public void customize(Connector connector) {
connector.setProperty("relaxedQueryChars", "|");
}
});
return factory;
}
}

0 comments on commit efe6599

Please sign in to comment.