文章目录
linux相关
mvnw: Permission denied
chmod +x mvnw
curl请求ipv6接口
在Linux中我们常常使用curl去请求接口
curl -X GET http://ipv4:port/addr/
这是没问题的,但是我们针对ipv6同样这样请求
curl -X GET http://ipv6:port/addr/
会报错:
curl: (3) IPv6 numerical address used in URL without brackets
curl -X GET http://[ipv6]:port/addr/
ide相关
修改idea编译器堆内存
编译报错:OOM
javac OutOfMemoryError when compiling IDEA 7
解决
On the Mac this is another way to get there: Application menu > Preferences > Compiler
thrift相关
thrift编译错误
版本0.9.3
之前这个thrift文件在0.9.2下编译是没问题
解决
Springboot相关
单测
在使用mockMvc时遇到这个问题:
SpringBootTest : No qualifying bean of type 'org.springframework.test.web.servlet.MockMvc' available:
@RunWith(SpringRunner.class)
@SpringBootTest
public class ApplicationTest {
@Autowired
private WebApplicationContext webApplicationContext;
private MockMvc mockMvc;
@Before
public void setUp() {
mockMvc = MockMvcBuilders.webAppContextSetup(webApplicationContext).build();
}
Nginx相关
nginx自动过滤下滑线的header
nginx代理服务器,app发出的请求头被直接过滤了,当时想到nginx会自动过滤掉带有_的请求头信息,所以直接改了Nginx的配置当然也可以将app的request中header中的_改为-
修改nginx配置,在http中增加
vi /usr/local/nginx/conf/nginx.conf
underscores_in_headers on;
vhost中的配置也贴下吧
location / {
proxy_set_header Host $host:80;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header x-forwarded-for $remote_addr;
proxy_pass http://xxxxxxx:51001;
}