是否可以在每个路由的基础上将uri-parsing-mode
更改为relaxed-with-raw-query
?如果我在 application.conf
中更改它,所有路由都会更改,但我只需要在一个路由中使用它
最佳答案
不,因为解析是在路由之前完成的,所以决定已经做出了。不过,您可以做的就是打开 spray.can.server.raw-request-uri-header = on
。这将为每个请求添加一个自定义 header ,您可以在对原始详细信息感兴趣的路由中检查该 header 。
参见https://github.com/spray/spray/blob/master/spray-can/src/main/resources/reference.conf#L76有关设置的说明。
关于scala - 是否可以在每个路由的基础上将 uri-parsing-mode 更改为relaxed-with-raw-query?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29560447/