Skip to content

Conversation

@adfost
Copy link
Contributor

@adfost adfost commented Jan 5, 2022

Fixes a bug where Chinese filenames would be messed up when being downloaded.

Fixes https://github.com/minio/console/issues/1351

@jinapurapu
Copy link
Contributor

"+" being appended to end of filenames on download
Screenshot from 2022-01-05 14-25-07

@jinapurapu
Copy link
Contributor

Filenames being garbled if they contain "+", regardless of Chinese characters
Screenshot from 2022-01-05 14-49-36

@adfost adfost force-pushed the chinese_filename_bug_fix branch from a558b10 to d531482 Compare January 5, 2022 23:18
prakashsvmx
prakashsvmx previously approved these changes Jan 6, 2022
Copy link
Member

@prakashsvmx prakashsvmx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor comment.

otherwise
Tested. Changes look good to me. 👍

prakashsvmx
prakashsvmx previously approved these changes Jan 6, 2022
harshavardhana
harshavardhana previously approved these changes Jan 6, 2022
@harshavardhana
Copy link
Member

harshavardhana commented Jan 6, 2022

Strange unrelated test failure

=== RUN   TestGetLicenseInfoFromJWT
2022/01/06 18:19:22 failed to verify license: exp not satisfied
=== RUN   TestGetLicenseInfoFromJWT/error_because_missing_license
=== RUN   TestGetLicenseInfoFromJWT/error_because_invalid_license
2022/01/06 18:19:22 Failed to parse public key: key must be a PEM encoded PKCS1 or PKCS8 key
=== RUN   TestGetLicenseInfoFromJWT/license_successfully_verified
2022/01/06 18:19:22 failed to verify license: exp not satisfied
    config_test.go:80: GetLicenseInfoFromJWT() error = invalid license key, wantErr false
--- FAIL: TestGetLicenseInfoFromJWT (0.09s)
    --- PASS: TestGetLicenseInfoFromJWT/error_because_missing_license (0.00s)
    --- PASS: TestGetLicenseInfoFromJWT/error_because_invalid_license (0.00s)
    --- FAIL: TestGetLicenseInfoFromJWT/license_successfully_verified (0.04s)

@dvaldivia
Copy link
Collaborator

@harshavardhana that test started failing today, also on other PRs that didn't had go changes

@jinapurapu
Copy link
Contributor

Filenames with "?" are being modified on download
Screenshot from 2022-01-06 11-32-06

@harshavardhana
Copy link
Member

TestGetLicenseInfoFromJWT

Well the stored license in the test has expired

{
  "alg": "ES384",
  "typ": "JWT"
}.{
  "sub": "[email protected]",
  "cap": 50,
  "org": "Gringotts Inc.",
  "exp": 1641446169.001199,
  "plan": "STANDARD",
  "iss": "[email protected]",
  "aid": 1,
  "iat": 1609910169.001199
}.[Signature]

Expired @dvaldivia

> Wed Jan 05 2022 21:16:09 GMT-0800 (Pacific Standard Time)

@harshavardhana
Copy link
Member

NOTE we don't have JWT based license anymore and this test is meaningless..

@harshavardhana
Copy link
Member

First step lets remove the test as it's not meaningful and then also remove the JWT parsing code - this is not valid anymore.

@prakashsvmx
Copy link
Member

Filenames with "?" are being modified on download Screenshot from 2022-01-06 11-32-06

@jinapurapu
This is a browser limitation/bug. it would replace < > * : and few more characters if we are downloading.

An Example:
Line 1: Original File name
Line 2 Downloaded file name

image

@harshavardhana
Copy link
Member

Please rebase @adfost your PR.

prakashsvmx
prakashsvmx previously approved these changes Jan 7, 2022
Copy link
Member

@prakashsvmx prakashsvmx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Alevsk
Alevsk previously requested changes Jan 7, 2022

if (rspHeader) {
filename = rspHeader.split('"')[1];
let rspHeaderDecoded = decodeURIComponent(rspHeader);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
let rspHeaderDecoded = decodeURIComponent(rspHeader);
let rspHeaderDecoded = decodeFileName(rspHeader);

Please use the decodeFileName function located at portal-ui/src/common/utils.ts, that function will handle the error when a string cannot be decoded

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tried that that doesn't work

Copy link
Collaborator

@bexsoft bexsoft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Console download file name garbled

7 participants