Uncle Cthulhu 2022-11-24 21:24:38 阅读数:895
In the previous blog, RSA and AES were used to complete the encryption and decryption of the interface, but in the actual test process, occasionally there will be problems of `HTTP method names must be tokens`, `Connection prematurely closed BEFORE response`
Puzzled, Google and Baidu have been searched, but still can’t solve it, it’s useless to change the size of the request header, for example: SpringBoot: Invalid character found in method">SpringBoot: Invalid character found in methodmethod name. HTTP method names must be tokens_Moshow Zheng Kai's Blog-CSDN Blog_invalid character found in method
Later, by chance, I saw some ideas on deleting the request header in Gateway on stackoverflow, and after trying N times, I found that it was solved.
#Dependent base image jdk8FROM openjdk:8u275-slim#The port that needs to be exposed is the port of my project#EXPOSE 8000#author informationMAINTAINER xxxENV TZ GMT+8ENV JAR_NAME nxx.jarADD /target/$JAR_NAME $JAR_NAMEENV JAVA_OPTS -Dname=$JAR_NAME -server -Xmx512m -Xms512m -Xmn256m -Xss256k -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled -XX:+UseFastAccessorMethods -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=80 -XX:MetaspaceSize=256m -XX:MaxMetaspaceSize=256m -Duser.timezone=GMT+8# After starting the container, the default run command#ENTRYPOINT java $JAVA_OPTS -jar $JAR_NAME# Solution: Connection prematurely closed BEFORE response, step 1ENTRYPOINT java $JAVA_OPTS -Dreactor.netty.pool.leasingStrategy=lifo -jar $JAR_NAME
spring:cloud:# Solution: Connection prematurely closed BEFORE response, step 2gateway:# Solution: HTTP method names must be tokens I don't know whyfilter:remove-hop-by-hop:headers: Connection
So far I don’t know why, but it is solved. I hope that the passing master will answer it and give me advice.
copyright：author[Uncle Cthulhu]，Please bring the original link to reprint, thank you. https://en.javamana.com/2022/328/202211242120376882.html