[
https://issues.apache.org/jira/browse/HDFS-16636?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
lidayu updated HDFS-16636:
--------------------------
Description:
*When We Put a file,the filename have Chinese characters,like this:*
[hdfsadmin@VM-15-26-centos ~]$ curl -i -X PUT
"http://9.135.15.26:50070/webhdfs/v1/上游2.png?op=CREATE&user.name=hdfsadmin"
HTTP/1.1 307 TEMPORARY_REDIRECT
Cache-Control: no-cache
Expires: Fri, 17 Jun 2022 09:26:09 GMT
Date: Fri, 17 Jun 2022 09:26:09 GMT
Pragma: no-cache
Expires: Fri, 17 Jun 2022 09:26:09 GMT
Date: Fri, 17 Jun 2022 09:26:09 GMT
Pragma: no-cache
X-FRAME-OPTIONS: SAMEORIGIN
Set-Cookie:
hadoop.auth="u=hdfsadmin&p=hdfsadmin&t=simple&e=1655493969462&s=YvkwSAwETWr2BqfkRTvBHy0Yj2A=";
Path=/; HttpOnly
Location:
[http://VM-15-26-centos:50075/webhdfs/v1/%E4%B8%8A%E6%B8%B82.png?op=CREATE&user.name=hdfsadmin&namenoderpcaddress=9.135.15.26:9000&createflag=&createparent=true&overwrite=false|http://vm-15-26-centos:50075/webhdfs/v1/%E4%B8%8A%E6%B8%B82.png?op=CREATE&user.name=hdfsadmin&namenoderpcaddress=9.135.15.26:9000&createflag=&createparent=true&overwrite=false]
Content-Type: application/octet-stream
Content-Length: 0
[hdfsadmin@VM-15-26-centos ~]$ curl -i -X PUT
"http://VM-15-26-centos:50075/webhdfs/v1/%E4%B8%8A%E6%B8%B82.png?op=CREATE&user.name=hdfsadmin&namenoderpcaddress=9.135.15.26:9000&createflag=
&createparent=true&overwrite=false"
HTTP/1.1 100 Continue
HTTP/1.1 201 Created
*Location: hdfs://9.135.15.26:9000/*
*82.png* ----->(this cause problem,the line have no colon)
Content-Length: 0
Connection: close
*THE problem is:the location will A newline,normal ,the will a one line ,like
this:*
*Location: hdfs://9.135.15.26:9000/上游2.png ,*
*it will cause knox error:validate header,becuase the line have no ":",*
*!image-2022-06-17-17-34-43-294.png|width=615,height=393!*
add:
I have notice datanode code: Httpheaders.java
static void encodeAscii0(CharSequence seq, ByteBuf buf) {
int length = seq.length();
for (int i = 0 ; i < length; i++) {
buf.writeByte((byte) seq.charAt(i));{*}—>this will make "上” to asc ”10” ,10 in
asc is new line{*}
}
}
was:
*When We Put a file,the filename have Chinese characters,like this:*
[hdfsadmin@VM-15-26-centos ~]$ curl -i -X PUT
"http://9.135.15.26:50070/webhdfs/v1/上游2.png?op=CREATE&user.name=hdfsadmin"
HTTP/1.1 307 TEMPORARY_REDIRECT
Cache-Control: no-cache
Expires: Fri, 17 Jun 2022 09:26:09 GMT
Date: Fri, 17 Jun 2022 09:26:09 GMT
Pragma: no-cache
Expires: Fri, 17 Jun 2022 09:26:09 GMT
Date: Fri, 17 Jun 2022 09:26:09 GMT
Pragma: no-cache
X-FRAME-OPTIONS: SAMEORIGIN
Set-Cookie:
hadoop.auth="u=hdfsadmin&p=hdfsadmin&t=simple&e=1655493969462&s=YvkwSAwETWr2BqfkRTvBHy0Yj2A=";
Path=/; HttpOnly
Location:
[http://VM-15-26-centos:50075/webhdfs/v1/%E4%B8%8A%E6%B8%B82.png?op=CREATE&user.name=hdfsadmin&namenoderpcaddress=9.135.15.26:9000&createflag=&createparent=true&overwrite=false|http://vm-15-26-centos:50075/webhdfs/v1/%E4%B8%8A%E6%B8%B82.png?op=CREATE&user.name=hdfsadmin&namenoderpcaddress=9.135.15.26:9000&createflag=&createparent=true&overwrite=false]
Content-Type: application/octet-stream
Content-Length: 0
[hdfsadmin@VM-15-26-centos ~]$ curl -i -X PUT
"http://VM-15-26-centos:50075/webhdfs/v1/%E4%B8%8A%E6%B8%B82.png?op=CREATE&user.name=hdfsadmin&namenoderpcaddress=9.135.15.26:9000&createflag=
&createparent=true&overwrite=false"
HTTP/1.1 100 Continue
HTTP/1.1 201 Created
*Location: hdfs://9.135.15.26:9000/*
*82.png* ----->(this cause problem,the line have no colon)
Content-Length: 0
Connection: close
*THE problem is:the location will A newline,normal ,the will a one line ,like
this:*
*Location: hdfs://9.135.15.26:9000/上游2.png ,*
*it will cause knox error:validate header,becuase the line have no ":",*
*!image-2022-06-17-17-34-43-294.png|width=615,height=393!*
> Put Chinese characters File Name Cause http header error
> --------------------------------------------------------
>
> Key: HDFS-16636
> URL: https://issues.apache.org/jira/browse/HDFS-16636
> Project: Hadoop HDFS
> Issue Type: Bug
> Reporter: lidayu
> Priority: Major
> Attachments: image-2022-06-17-17-27-17-052.png,
> image-2022-06-17-17-34-43-294.png
>
>
> *When We Put a file,the filename have Chinese characters,like this:*
> [hdfsadmin@VM-15-26-centos ~]$ curl -i -X PUT
> "http://9.135.15.26:50070/webhdfs/v1/上游2.png?op=CREATE&user.name=hdfsadmin"
>
> HTTP/1.1 307 TEMPORARY_REDIRECT
> Cache-Control: no-cache
> Expires: Fri, 17 Jun 2022 09:26:09 GMT
> Date: Fri, 17 Jun 2022 09:26:09 GMT
> Pragma: no-cache
> Expires: Fri, 17 Jun 2022 09:26:09 GMT
> Date: Fri, 17 Jun 2022 09:26:09 GMT
> Pragma: no-cache
> X-FRAME-OPTIONS: SAMEORIGIN
> Set-Cookie:
> hadoop.auth="u=hdfsadmin&p=hdfsadmin&t=simple&e=1655493969462&s=YvkwSAwETWr2BqfkRTvBHy0Yj2A=";
> Path=/; HttpOnly
> Location:
> [http://VM-15-26-centos:50075/webhdfs/v1/%E4%B8%8A%E6%B8%B82.png?op=CREATE&user.name=hdfsadmin&namenoderpcaddress=9.135.15.26:9000&createflag=&createparent=true&overwrite=false|http://vm-15-26-centos:50075/webhdfs/v1/%E4%B8%8A%E6%B8%B82.png?op=CREATE&user.name=hdfsadmin&namenoderpcaddress=9.135.15.26:9000&createflag=&createparent=true&overwrite=false]
> Content-Type: application/octet-stream
> Content-Length: 0
> [hdfsadmin@VM-15-26-centos ~]$ curl -i -X PUT
> "http://VM-15-26-centos:50075/webhdfs/v1/%E4%B8%8A%E6%B8%B82.png?op=CREATE&user.name=hdfsadmin&namenoderpcaddress=9.135.15.26:9000&createflag=
> &createparent=true&overwrite=false"
> HTTP/1.1 100 Continue
> HTTP/1.1 201 Created
> *Location: hdfs://9.135.15.26:9000/*
> *82.png* ----->(this cause problem,the line have no colon)
> Content-Length: 0
> Connection: close
>
>
> *THE problem is:the location will A newline,normal ,the will a one line ,like
> this:*
> *Location: hdfs://9.135.15.26:9000/上游2.png ,*
> *it will cause knox error:validate header,becuase the line have no ":",*
> *!image-2022-06-17-17-34-43-294.png|width=615,height=393!*
> add:
> I have notice datanode code: Httpheaders.java
> static void encodeAscii0(CharSequence seq, ByteBuf buf) {
> int length = seq.length();
> for (int i = 0 ; i < length; i++) {
> buf.writeByte((byte) seq.charAt(i));{*}—>this will make "上” to asc ”10” ,10
> in asc is new line{*}
> }
> }
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]