%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8" %>
<%@ page import="org.springframework.web.util.HtmlUtils" %>
<%
jakarta.servlet.http.HttpSession headerSession = request.getSession(false);
boolean headerLoggedIn = headerSession != null && headerSession.getAttribute("userId") != null;
String headerProfileHref = request.getContextPath() + (headerLoggedIn ? "/profile" : "/login");
String headerProfileLabel = headerLoggedIn ? "프로필" : "로그인";
String rawHeaderAvatarUrl = headerSession != null && headerSession.getAttribute("avatarUrl") != null
? String.valueOf(headerSession.getAttribute("avatarUrl"))
: "";
String headerAvatarUrl = HtmlUtils.htmlEscape(rawHeaderAvatarUrl);
boolean headerHasAvatar = headerLoggedIn && !rawHeaderAvatarUrl.isBlank();
%>