upload an attachment was failed "Error 403 : Forbidden" if json file has Japanese(Kanji) data

RESOLVED FIXED

Status

addons.mozilla.org Graveyard
Add-on Builder
P1
major
RESOLVED FIXED
6 years ago
4 years ago

People

(Reporter: backy0175, Assigned: zalun)

Tracking

Details

Attachments

(2 attachments)

(Reporter)

Description

6 years ago
Created attachment 660153 [details]
Edit addon - Add-on Builder - 2 screenshots

User Agent: Mozilla/5.0 (Windows NT 5.1; rv:15.0) Gecko/20100101 Firefox/15.0.1
Build ID: 20120905151427

Steps to reproduce:

I am trying to attach json file which have Japanese(Kanji) data.


Actual results:

upload an attachment was failed "Error 403 : Forbidden".

I tested 4 encordings "UTF-8 without BOM", "UTF-8 with BOM", "UTF-16 without BOM", "UTF-16 with BOM",
but failed all of them.


Expected results:

Add-on Builder should handle Japanese properly.
(Reporter)

Updated

6 years ago
Severity: normal → major
(Assignee)

Comment 1

6 years ago
Please provide an attachment with Kanji.
In the format you consider the most popular.
Assignee: nobody → zaloon
Priority: -- → P1
(Reporter)

Comment 2

6 years ago
Here you are.

You can download simple json files from Google Drive.
https://docs.google.com/open?id=0B7x9FcIJnkg5d3lrSDladnYzQ1U

and I tested again, results as follows.

json with Kanji encoded UTF-8 with BOM -> 403 Forbidden
json with Kanji encoded UTF-8 without BOM -> 403 Forbidden
json with Kanji encoded UTF-16LE with BOM -> successfully attached but Kanji is 
broken
json with Kanji encoded UTF-16LE without BOM -> successfully attached but Kanji is broken
json with Kanji encoded UTF-16BE with BOM -> successfully attached but Kanji is broken
json with Kanji encoded UTF-16BE without BOM -> successfuly attached but Kanji is broken
(Assignee)

Comment 3

6 years ago
There is an issue.

https://github.com/mozilla/FlightDeck/blob/master/apps/jetpack/views.py#L723
Removing this code fixes the above issue, but breaks the test with jquery mpiotr.zalewa.info/downloads/jquery-1.6.4.min.jsinified file - https://github.com/mozilla/FlightDeck/blob/master/apps/jetpack/tests/attachment_test.py#L93

I believe the question is which file is properly encoded, if we should allow both then it's a different story:

* piotr.zalewa.info/downloads/kanji_utf8.json
* piotr.zalewa.info/downloads/jquery-1.6.4.min.js

Please advice
(Assignee)

Comment 4

6 years ago
Created attachment 661277 [details]
A file with Kanji which is passing the attachment tests
(Assignee)

Comment 5

6 years ago
I found a way, but I consider it flaky, please tell me if attachment 661277 [details] is properly encoded ... I made it by copy & paste into vi and saved it... It is passing the test without any changes to the code.
(Assignee)

Comment 6

6 years ago
sorry - cancel the last message
(Assignee)

Comment 7

6 years ago
Fix is waiting for code review https://github.com/mozilla/FlightDeck/pull/165
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
(Assignee)

Updated

6 years ago
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Product: addons.mozilla.org → addons.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.