Skip to content

Commit

Permalink
fix:occur a 400 error request when openapi key's parameter contain "a…
Browse files Browse the repository at this point in the history
…[0]" (#4424)

* fix:occur a 400 error request when openapi key's parameter contain "a[0]"(#4422)

* update CHANGES.md
  • Loading branch information
CalebZYC authored Jun 21, 2022
1 parent b73204a commit 7d25d55
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ Apollo 2.1.0
* [feat(apollo-client): the spi of config service load balancer client](https://github.com/apolloconfig/apollo/pull/4394)
* [add cat-client as optional dependency](https://github.com/apolloconfig/apollo/pull/4414)
* [refactor Functions class with lambda](https://github.com/apolloconfig/apollo/pull/4419)
* [fix:occur a 400 error request when openapi key's parameter contain "a[0]"](https://github.com/apolloconfig/apollo/pull/4424)
------------------
All issues and pull requests are [here](https://github.com/apolloconfig/apollo/milestone/11?closed=1)
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,30 @@
*/
package com.ctrip.framework.apollo.openapi;

import com.ctrip.framework.apollo.common.controller.WebMvcConfig;

import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

@EnableAutoConfiguration
@Configuration
@ComponentScan(basePackageClasses = PortalOpenApiConfig.class)
public class PortalOpenApiConfig {

@Component
static class PortalWebMvcConfig extends WebMvcConfig {
@Override
public void customize(TomcatServletWebServerFactory factory) {
final String relaxedChars = "<>[\\]^`{|}";
final String tomcatRelaxedpathcharsProperty = "relaxedPathChars";
final String tomcatRelaxedquerycharsProperty = "relaxedQueryChars";
factory.addConnectorCustomizers(connector -> {
connector.setProperty(tomcatRelaxedpathcharsProperty, relaxedChars);
connector.setProperty(tomcatRelaxedquerycharsProperty, relaxedChars);
});
}
}
}

0 comments on commit 7d25d55

Please sign in to comment.