プロジェクト

全般

プロフィール

Vote #76625

未完了

Filtered API calls delete CORS

Admin Redmine さんが約4年前に追加. 約4年前に更新.

ステータス:
New
優先度:
通常
担当者:
-
カテゴリ:
REST API_32
対象バージョン:
-
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
32
version_id:
0
issue_org_id:
20472
author_id:
34870
assigned_to_id:
0
comments:
0
status_id:
1
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
81
ステータス-->[New]

説明

This is a strange behaviour of the API. I'm using rack-cors to enable API consuming by other apps (Ember.js).

When using various endpoints (/issues.json, time_entries.json, projects.json) everything is ok.

With this specific call, CORS headers aren't added to the response and the browser blocks the request with the "famous" error: @No 'Access-Control-Allow-Origin' header is present on the requested resource@
The call is:

/time_entries.json?user_id=
or
/time_entries.json?user_id=me

The only added header is:

X-Rack-CORS: preflight-hit; no-origin

If I change the param with something not recognized by redmine (e.g. ?wrong_param=me), everything works well (the response isn't filtered). So the problem seems to be related to the filtering of the time entries by user.
Maybe with this particular filtering redmine creates a different response which avoid the rack-cors action?

The correct headers, added by rack-cors, should be:

Access-Control-Allow-Origin: http://localhost:4200
Access-Control-Allow-Methods: GET, POST, DELETE, PUT, OPTIONS, HEAD
Access-Control-Max-Age: 0
Access-Control-Allow-Credentials: true
X-Rack-CORS: hit

Admin Redmine さんが約4年前に更新

  • カテゴリREST API_32 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0