5

通常、ftp url 形式はftp://user[:pass]@ip[:port]/path

しかし今、私はこの文字列を得ました:

ftp://dude:1.1.1.1@1.1.1.1/@1.1.1.1/fml

解析結果が次のようになる可能性があるため、あいまいなようです。

  1. password=1.1.1.1, path=@1.1.1.1/fml
  2. password=1.1.1.1@1.1.1.1/, path=fml

これは違法であることをクライアントに伝える必要がありますか、それとももっと友好的な対処方法はありますか? ありがとう..

4

1 に答える 1

5

ユーザー名とパスワードの特殊文字

リモート サーバーで認証が必要な場合は、入力 URL 文字列にユーザー名とパスワードを含めることができます。ユーザー名とパスワードには、次の特殊文字をパーセントでエンコードする必要があります。

] [ ? / < ~ # ` ! @ $ % ^ & * ( ) + = } | : " ; ' , > { スペース

例:

http://example.com/path/to/input.avi
https://example.com/path/to/input.mov
ftp://example.com/path/to/input.mp3
sftp://example.com/path/to/input.3gp
https://s3.amazonaws.com/bucket-name/input.mpeg
s3://bucket-name/input.mpeg (shorthand for the full HTTP S3 url)
Examples (with username "user" and password "pass!word"):

http://user:pass%21word@example.com/path/to/input.avi
https://user:pass%21word@example.com/path/to/input.mov
ftp://user:pass%21word@example.com/path/to/input.mp3
sftp://user:pass%21word@example.com/path/to/input.3gp
ftp://user:pass%21word@example.com/path/to/input.mp3
Some servers require the username include your domain name (username "user@example.com" and password "pass!word"):

http://user%40example.com:pass%21word@example.com/path/to/input.avi
https://user%40example.com:pass%21word@example.com/path/to/input.mov
ftp://user%40example.com:pass%21word@example.com/path/to/input.mp3
sftp://user%40example.com:pass%21word@example.com/path/to/input.3gp
ftp://user%40example.com:pass%21word@example.com/path/to/input.mp3
于 2014-07-16T13:50:56.813 に答える