【发布时间】:2016-12-22 00:00:45
【问题描述】:
在 javascript 中,我正在对路径进行编码并附加到 URL。在 GET 调用中,REST URL 在分号后被截断。
路径名: !#;@$^&()_+{}:,.'[]
encodeURI(路径名): %21%23%3B%40%24%5E%26%28%29_%2B%7B%7D%3A%2C.%27%5B%5D
网址+路径: ../reports/SMC-%21%23%3B%40%24%5E%26%28%29_%2B%7B%7D%3A%2C.%27%5B%5D/configs?_=1482329220060
@GET
@Path("/{report_name}/configs")
@Produces({ MediaType.APPLICATION_JSON })
@ApiOperation(value = "Fetches the configurations of the report",httpMethod = HttpMethod.GET, response = ReportConfigOptions.class)
public Response getAllConfigOptions(@PathParam("report_name") String fqReportName,
@QueryParam("context_parameters") ReportContextParameters contextParameters,
@QueryParam("apply_locale") boolean applyLocale) {
@PathParam("report_name") String fqReportName
....
fqReportName 将在分号 (;) 之后被截断 fqReportName : !#
是否可以阻止这种传输?
【问题讨论】: