SafeRedirectStrategy.java 文件源码

java
阅读 26 收藏 0 点赞 0 评论 0

项目:CurseSync 作者:
@Override
protected URI createLocationURI(String location) throws ProtocolException
{
    try
    {
        final URIBuilder b = new URIBuilder(new URI(encode(location)).normalize());
        final String host = b.getHost();
        if (host != null)
        {
            b.setHost(host.toLowerCase(Locale.ROOT));
        }
        final String path = b.getPath();
        if (TextUtils.isEmpty(path))
        {
            b.setPath("/");
        }
        return b.build();
    }
    catch (final URISyntaxException ex)
    {
        throw new ProtocolException("Invalid redirect URI: " + location, ex);
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号