keeleinstituut / tv-tolkevarav

Tõlkevärav (Translation Hub)
1 stars 0 forks source link

Can't download files from "Tagasiside failid" (BE) #748

Open plakitkelly opened 2 months ago

plakitkelly commented 2 months ago

All users (client, pm, main user)

By clicking on downloading button, user sees Teadmata viga: 404

MariusJulius commented 2 months ago

@plakitkelly please add the order reference here.

plakitkelly commented 2 months ago

LOL-2024-04-TT-441

kadmit commented 1 month ago

@MariusJulius @KaarelKa

BE PR: https://github.com/keeleinstituut/tv-translation-order/pull/137

I had to change the API so we will need to make some changes on FE also.

The logic of how it works is described in Swagger docs: Screenshot 2024-05-31 at 13 02 17

plakitkelly commented 2 weeks ago

@KaarelKa needs FE? https://dev.tolkevarav.eki.ee/projects/9c50dbb8-f253-427d-aff0-afdd5077075b my PIC

Image

KaarelKa commented 2 weeks ago

@kadmit Hey, I did the changes on FE, the request now works, but there seems to be a permissions issue. I'm currently logged in as the translation manager of a project, but I get error 403, when trying to download the review file

kadmit commented 1 week ago

@KaarelKa

I found that currently, FE is doing requests wrongly. Here are the things that should be fixed to allow review files to be downloadable:

Example of the request:

curl 'https://dev.tolkevarav.eki.ee/gateway/translation-order/api/media/download?id=3175&reference_object_id=9bd43982-0a3d-4ddb-9646-6d4e299d5853&reference_object_type=review&collection=review' \
  -H 'accept: application/json, text/plain, */*' \
  -H 'accept-language: en-US,en;q=0.9,ru;q=0.8' \
  -H 'cache-control: no-cache' \
  -H 'cookie: session-expires=1719319908; appSession.0={session ID}' \
  -H 'pragma: no-cache' \
  -H 'priority: u=1, i' \
  -H 'referer: https://dev.tolkevarav.eki.ee/projects/9bd43785-5fba-4a93-a346-a3224cda883b' \
  -H 'sec-ch-ua: "Not/A)Brand";v="8", "Chromium";v="126", "Google Chrome";v="126"' \
  -H 'sec-ch-ua-mobile: ?0' \
  -H 'sec-ch-ua-platform: "macOS"' \
  -H 'sec-fetch-dest: empty' \
  -H 'sec-fetch-mode: cors' \
  -H 'sec-fetch-site: same-origin' \
  -H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36'