Closed Bug 790318 Opened 12 years ago Closed 12 years ago

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

Categories

(addons.mozilla.org Graveyard :: Add-on Builder, defect, P1)

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: backy0175, Assigned: zalun)

Details

Attachments

(2 files)

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.
Severity: normal → major
Please provide an attachment with Kanji.
In the format you consider the most popular.
Assignee: nobody → zaloon
Priority: -- → P1
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
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
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.
sorry - cancel the last message
Fix is waiting for code review https://github.com/mozilla/FlightDeck/pull/165
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Status: ASSIGNED → RESOLVED
Closed: 12 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.

Attachment

General

Creator:
Created:
Updated:
Size: