StarRocks / starrocks

StarRocks, a Linux Foundation project, is a next-generation sub-second MPP OLAP database for full analytics scenarios, including multi-dimensional analytics, real-time analytics, and ad-hoc queries.
https://starrocks.io
Apache License 2.0
8.26k stars 1.67k forks source link

[BugFix] didn't catch the exception in getAuthorizationInfo #47639

Closed blanklin030 closed 1 hour ago

blanklin030 commented 3 days ago

Why I'm doing:

when send abnormal Authorization, didn't response the normal content,

  • the demo like below:
    curl -i --location --request PUT 'http://127.0.0.1:7030/api/database_test/tb_test/_stream_load' \
    --header 'jsonpaths: ["$.id", "$.name", "$.dt"]' \
    --header 'format: json' \
    --header 'columns: id, name, dt, __op ='\''upsert'\''' \
    --header 'strict_mode: true' \
    --header 'Expect: 100-continue' \
    --header 'Content-Type: text/plain' \
    --header 'Authorization: Basic xxx' \
    --data '{
    "id": "101",
    "name": "xhl",
    "dt": "2024-06-25"
    }
    {
    "id": "102",
    "name": "ly",
    "dt": "2024-06-25"
    }'
  • the response like below:
    curl: (52) Empty reply from server

    What I'm doing:

    make the normal http resonse for all http api, like below

    {"status":"FAILED","msg":"Need auth information."}

    Fixes #47636

What type of PR is this:

Does this PR entail a change in behavior?

If yes, please specify the type of change:

Checklist:

Bugfix cherry-pick branch check:

sonarcloud[bot] commented 7 hours ago

Quality Gate Passed Quality Gate passed

Issues
1 New issue
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

github-actions[bot] commented 6 hours ago

[FE Incremental Coverage Report]

:white_check_mark: pass : 11 / 12 (91.67%)

file detail

path covered_line new_line coverage not_covered_line_detail
:large_blue_circle: com/starrocks/http/BaseAction.java 11 12 91.67% [368]
github-actions[bot] commented 6 hours ago

[BE Incremental Coverage Report]

:white_check_mark: pass : 0 / 0 (0%)

github-actions[bot] commented 1 hour ago

@Mergifyio backport branch-3.3

github-actions[bot] commented 1 hour ago

@Mergifyio backport branch-3.2

github-actions[bot] commented 1 hour ago

@Mergifyio backport branch-3.1

mergify[bot] commented 1 hour ago

backport branch-3.3

✅ Backports have been created

* [#47703 [BugFix] didn't catch the exception in getAuthorizationInfo (backport #47639)](https://github.com/StarRocks/starrocks/pull/47703) has been created for branch `branch-3.3`
mergify[bot] commented 1 hour ago

backport branch-3.2

✅ Backports have been created

* [#47704 [BugFix] didn't catch the exception in getAuthorizationInfo (backport #47639)](https://github.com/StarRocks/starrocks/pull/47704) has been created for branch `branch-3.2`
mergify[bot] commented 1 hour ago

backport branch-3.1

✅ Backports have been created

* [#47705 [BugFix] didn't catch the exception in getAuthorizationInfo (backport #47639)](https://github.com/StarRocks/starrocks/pull/47705) has been created for branch `branch-3.1`