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

fix: 开放ErrUnauthorized错误供外界使用 #23

Merged
merged 1 commit into from
Apr 5, 2024

Conversation

longyue0521
Copy link
Contributor

当前ginx开放给外界使用的仅有ErrNoResponse, 而ErrUnauthorized并未开放,所以下方代码也就无法被外界利用

// 如果里面有权限校验,那么会返回 401 错误(目前来看,主要是登录态校验)
		if errors.Is(err, errs.ErrUnauthorized) {
			slog.Debug("未授权", slog.Any("err", err))
			ctx.AbortWithStatus(http.StatusUnauthorized)
			return
		}

故开放ErrUnauthorized

Copy link

codecov bot commented Apr 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.75%. Comparing base (80840e6) to head (d74c06b).

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #23   +/-   ##
=======================================
  Coverage   83.75%   83.75%           
=======================================
  Files          20       20           
  Lines         591      591           
=======================================
  Hits          495      495           
  Misses         88       88           
  Partials        8        8           

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

@flycash flycash merged commit b236eb6 into ecodeclub:main Apr 5, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants