Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support display HTML format in API error responses #7127

Merged
merged 2 commits into from
Dec 16, 2024

Conversation

ruibaby
Copy link
Member

@ruibaby ruibaby commented Dec 11, 2024

What type of PR is this?

/kind feature
/area ui
/milestone 2.20.x

What this PR does / why we need it:

Add supports for display HTML format in API error responses

See #7115

Examples:

image image

Which issue(s) this PR fixes:

Fixes #7115

Special notes for your reviewer:

Nginx mock example:

server {
    listen 80;
    server_name localhost;

    error_page   500 502 503 504  /50x.html;

    location = /50x.html {
        root   /usr/share/nginx/html;
    }

    location / {
      proxy_pass http://localhost:8090;
      proxy_set_header HOST $host;
      proxy_set_header X-Forwarded-Proto $scheme;
      proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }

    location ^~ /apis/content.halo.run/v1alpha1/posts/ {
        return 403;
    }
}

Does this PR introduce a user-facing change?

支持显示来自反向代理或者 WAF 的请求错误信息

@f2c-ci-robot f2c-ci-robot bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/feature Categorizes issue or PR as related to a new feature. labels Dec 11, 2024
@f2c-ci-robot f2c-ci-robot bot added this to the 2.20.x milestone Dec 11, 2024
@f2c-ci-robot f2c-ci-robot bot requested a review from JohnNiang December 11, 2024 09:32
@f2c-ci-robot f2c-ci-robot bot added the area/ui Issues or PRs related to the Halo UI label Dec 11, 2024
@f2c-ci-robot f2c-ci-robot bot requested a review from wan92hen December 11, 2024 09:32
Copy link

codecov bot commented Dec 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 57.19%. Comparing base (eff73dc) to head (b72b8fd).
Report is 79 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #7127      +/-   ##
============================================
+ Coverage     56.99%   57.19%   +0.20%     
- Complexity     3999     4047      +48     
============================================
  Files           714      719       +5     
  Lines         24110    24352     +242     
  Branches       1585     1598      +13     
============================================
+ Hits          13742    13929     +187     
- Misses         9756     9805      +49     
- Partials        612      618       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ruibaby ruibaby requested review from LIlGG and guqing December 11, 2024 09:44
Copy link
Member

@guqing guqing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@f2c-ci-robot f2c-ci-robot bot added lgtm Indicates that a PR is ready to be merged. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Dec 11, 2024
@f2c-ci-robot f2c-ci-robot bot removed lgtm Indicates that a PR is ready to be merged. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Dec 16, 2024
@ruibaby ruibaby requested a review from guqing December 16, 2024 02:01
Copy link
Member

@JohnNiang JohnNiang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@f2c-ci-robot f2c-ci-robot bot added the lgtm Indicates that a PR is ready to be merged. label Dec 16, 2024
Copy link

f2c-ci-robot bot commented Dec 16, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JohnNiang

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@f2c-ci-robot f2c-ci-robot bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 16, 2024
@f2c-ci-robot f2c-ci-robot bot merged commit 41ea81c into halo-dev:main Dec 16, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/ui Issues or PRs related to the Halo UI kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

优化来自前置代理的异常请求提示
3 participants