Skip to content

Instantly share code, notes, and snippets.

@kjunichi
Created June 12, 2024 01:25
Show Gist options
  • Save kjunichi/273e184fe1b4b9d05cefdfa7e7a0a01b to your computer and use it in GitHub Desktop.
Save kjunichi/273e184fe1b4b9d05cefdfa7e7a0a01b to your computer and use it in GitHub Desktop.
サーブレットフィルタでHttpヘッダを加工する
import javax.servlet.http.*;
public class MyHttpServletRequestWrapper extends HttpServletRequestWrapper {
public MyHttpServletRequestWrapper(HttpServletRequest req) {
super(req);
}
public String getHeader(String name) {
if("UPN".equals(name)) {
return "123456";
}
return super.getHeader(name);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment