UrlEncoder/UrlDecoder

  • 암호화된 값이 '/' 슬래시를 포함하는 경우가 있었다. '/' 를 다른 문자열로 수동치환하기 보다는 Url 인코더, 디코더를 이용해보자. 
  • spring 의 @PathVariable 애노테이션은 UrlEncoder 인코딩 된 값을 자동으로 디코딩처리해준다.
@Test
fun `urlEncode 를 수행한다`() {

    val plain = "test/sample/online"

    plain.urlEncode() shouldBe "test%2Fsample%2Fonline"
    plain.urlDecode() shouldBe "test/sample/online"
}

 

spring cache

  • 실무에서 레디스를 주로 쓰거나, 혹은 로컬캐시를 ConcurrentHashMap<> 형태로 썼다. 스프링에서 제공해주는건 써보진 않았다. 그래서 혼자 맛만 봤다. 관련링크

 

ingress-nginx annotation

 

openlens

  • k8s 무료 오픈소스 툴
  • 대시보드를 편하게 볼 수 있음
  • 다양한 익스텐션이 있어서 필요에 따라 설치하면 된다.
    • @alebcay/openlens-node-pod-menu : 설치 시 파드 내 컨테이너 접속 및 파드로그를 실시간을 조회 가능

 

Deprecating the "X-" Prefix and Similar Constructs in Application Protocols

  • 비표준 헤더인 "X-" 를 쓰지말고 표준헤더를 사용하자. 과거에는 사용자 정의 헤더를 "X-" 를 사용하도록 했지만 명시적인 헤더이름을 가지도록 권장하고 있다. 예를들어 Authorization 등.
  • 참고 : https://datatracker.ietf.org/doc/html/rfc6648

 

Posted by doubler
,