[
https://issues.apache.org/jira/browse/HDFS-2025?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13042709#comment-13042709
]
sravankorumilli commented on HDFS-2025:
---------------------------------------
In DatanodeJspHelper.generateFileChunksForTail
{code:title=DatanodeJspHelper.java|borderStyle=solid}
static void generateFileChunksForTail(JspWriter out, HttpServletRequest req,
Configuration conf) throws IOException,InterruptedException {
final String referrer = JspHelper.validateURL(req.getParameter("referrer"));
//this will encode the referrer url in UTF-8
//some more code
//the encoded url is itself being used in hyperlink
out.print("<a href=\"" + referrer + "\">Go Back to File View</a><hr>");
}
{code}
Here JspHelper.validateURL(req.getParameter("referrer")) will encode the
referrer in UTF-8 and the same will be used as hyperlink which is treated as a
relative url. I have attached the snapshot of the error
The solution can be simple not to encode.
> Go Back to File View link is not working in tail.jsp
> ----------------------------------------------------
>
> Key: HDFS-2025
> URL: https://issues.apache.org/jira/browse/HDFS-2025
> Project: Hadoop HDFS
> Issue Type: Bug
> Components: data-node
> Affects Versions: 0.20.1, 0.23.0
> Reporter: sravankorumilli
> Assignee: sravankorumilli
> Priority: Minor
> Attachments: ScreenShot_1.jpg
>
>
> While browsing the file system.
> Click on any file link to go to the page where the file contents are
> displayed, then when we click on '*Tail this file*' link.
> The control will go to the tail.jsp here when we
> Click on '*Go Back to File View*' option.
> HTTP Error page not found will come.
> This is because the referrer URL is encoded and the encoded URL is itself
> being used in the '*Go Back to File View*' hyperlink which will be treated as
> a relative URL and thus the HTTP request will fail.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira