All posts by 龙生

Webpack源代码泄露漏洞研究

Webpack 会为打包后的代码生成 Source Map 文件,以便在运行时可以调试源代码。然而,如果开发人员在生产环境中没有正确地配置 SourceMap,攻击者就可能获得敏感信息,例如源代码和服务器配置等。

攻击者可以通过发送 HTTP 请求来获取 Source Map 文件,并从中获取敏感信息。

龙生   20 Oct 2023
View Details

logback配置文件

logback-spring.xml

 

龙生   24 Sep 2023
View Details

Logback使用conversionRule自定义字符的坑

Logback使用conversionRule自定义字符的坑 背景 想在logback输出的文件目录中加入ip,使用 <conversionRule conversionWord="ip" converterClass="com.test.config.LogIpConfig" />结果一直报错: There is no conversion class registered for conversion word [ip] [ip] is not a valid conversion word 原因 当需要在日志记录中添加自定义文本时,仅支持在<pattern>中添加ip或其他自定义的字段,不支持在目录或文件名<fileNamePattern>中使用。 可能是格式或类书写错误。如class路径错误,logger的name指向不存在的包名。 当使用失败时,建议使用删除大法,将各种配置都删除,只留下一个纯净的结构,如 http://logback.qos.ch/manual/layouts.html

 

  其他方法 如果想在文件目录或文件名中添加自定义字段,可以引入springboot中的参数<springProperty scope="context" name="LOG_HOME" source="logPath"/>,此处不展开。 如果需要使用springboot配置中不存在的参数,可以在logback-spring.xml中加入<define> 如

 

  即可在目录或文件名中添加自己想要的参数。   from:https://blog.csdn.net/NNNathan/article/details/114667320

龙生   07 Sep 2023
View Details

RabbitMQ消费消息坑:failed to convert serialized Message content

@Bean
public MessageConverter messageConverter() {
return new Jackson2JsonMessageConverter();
}

龙生   02 Sep 2023
View Details

Java开发中排除依赖项

Maven

  Gradle

 

龙生   26 Aug 2023
View Details

SpringBoot项目集成Swagger和swagger-bootstrap-ui以及常用注解使用方法

一、前言
二、SpringBoot项目集成swagger
1. 引入依赖
2. 编写配置文件
3. 启动访问页面
三、SpringBoot项目集成swagger-bootstrap-ui
1.引入依赖
2.配置资源处理规则
3.启动访问页面
四、Swagger常用注解介绍
1.Swagger2Config中相关swagger注解
2.controller中相关swagger注解
3.Model中相关swagger注解

龙生   26 Aug 2023
View Details

Swagger文档在SpringBoot框架下的配置,Swagger配置登录验证

## 开启 Swagger的 Basic认证功能,默认是false
swagger:
# 是否关闭 swagger接口文档访问
# production: true
basic:
# 开启简单用户验证
enable: true
# 用户名(自由发挥)
username: xx
# 用户密码(自由发挥)
password: xx

龙生   26 Aug 2023
View Details

Gradle报错Could not resolve all dependencies for configuration ‘:detachedConfiguration7‘.

修改方式有两种:

第一种:在仓库前添加关键字:allowInsecureProtocol = true
第二种:将阿里云的连接http换成https

龙生   26 Aug 2023
View Details

SpringBoot升级2.4.0所出现的问题:When allowCredentials is true, allowedOrigins cannot contain the specia

跨域配置报错,将.allowedOrigins替换成.allowedOriginPatterns即可。

龙生   26 Aug 2023
View Details

访问swagger-ui.html 404报错一秒解决

在application.properties 加上这个

spring.mvc.pathmatch.matching-strategy=ant_path_matcher

龙生   26 Aug 2023
View Details
1 34 35 36 408