com.apzda.cloud.sentinel.callback.StandardRequestOriginParser Maven / Gradle / Ivy
The newest version!
package com.apzda.cloud.sentinel.callback;
import com.apzda.cloud.adapter.spring.callback.RequestOriginParser;
import com.apzda.cloud.gsvc.server.IServiceMethodHandler;
import jakarta.servlet.http.HttpServletRequest;
import org.apache.commons.lang3.StringUtils;
import static com.apzda.cloud.gsvc.server.IServiceMethodHandler.GTW;
/**
* @author fengz
*/
public class StandardRequestOriginParser implements RequestOriginParser {
@Override
public String parseOrigin(HttpServletRequest request) {
return StringUtils.defaultIfBlank(request.getHeader(IServiceMethodHandler.CALLER_HEADER), GTW);
}
}