mirror of
https://github.com/TheWhiteDog9487/WebAPI.git
synced 2026-08-11 23:01:30 +08:00
记录客户端UA
This commit is contained in:
+1
-1
@@ -7,7 +7,7 @@ plugins {
|
|||||||
}
|
}
|
||||||
|
|
||||||
group = "xyz.thewhitedog9487"
|
group = "xyz.thewhitedog9487"
|
||||||
version = "0.4.3"
|
version = "0.4.4"
|
||||||
|
|
||||||
java {
|
java {
|
||||||
toolchain {
|
toolchain {
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ class OpenAPIConfiguration {
|
|||||||
.contact(new Contact()
|
.contact(new Contact()
|
||||||
.name("TheWhiteDog9487")
|
.name("TheWhiteDog9487")
|
||||||
.url("https://www.github.com/TheWhiteDog9487/WebAPI"))
|
.url("https://www.github.com/TheWhiteDog9487/WebAPI"))
|
||||||
.version("0.4.3")
|
.version("0.4.4")
|
||||||
.license(new License()
|
.license(new License()
|
||||||
.name("WTFPL")
|
.name("WTFPL")
|
||||||
.url("https://spdx.org/licenses/WTFPL")) )
|
.url("https://spdx.org/licenses/WTFPL")) )
|
||||||
|
|||||||
@@ -36,4 +36,9 @@ public class LogClientInfo extends OncePerRequestFilter {
|
|||||||
log.info("请求携带了CF-IPCountry头部,ISO3166代码:{},对应的国家/地区:{}", IP, Country.getDisplayCountry(Locale.SIMPLIFIED_CHINESE)); }
|
log.info("请求携带了CF-IPCountry头部,ISO3166代码:{},对应的国家/地区:{}", IP, Country.getDisplayCountry(Locale.SIMPLIFIED_CHINESE)); }
|
||||||
else {
|
else {
|
||||||
log.info("请求未携带CF-IPCountry头部,无法获取国家/地区信息。"); }
|
log.info("请求未携带CF-IPCountry头部,无法获取国家/地区信息。"); }
|
||||||
|
var UserAgent = request.getHeader("User-Agent");
|
||||||
|
if( UserAgent == null ){
|
||||||
|
log.info("请求未携带User-Agent头部,无法获取客户端软件信息。"); }
|
||||||
|
else{
|
||||||
|
log.info("请求的User-Agent:{}", UserAgent); }
|
||||||
filterChain.doFilter(request, response); } }
|
filterChain.doFilter(request, response); } }
|
||||||
Reference in New Issue
Block a user