Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Http4s blaze should provide better feedback when rejecting a bad request (400)

Đang mở
#665 1 bình luận 2 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
scala
Lĩnh vực
backend

Hướng nghiên cứu

Bắt đầu tại blaze-server/src/main/scala/org/http4s/server/blaze/Http1ServerStage.scala, khoảng dòng 317, nơi issue xác định log ở mức debug cho các request bị từ chối. Xem xét hiện tại response 400 và logging hoạt động như thế nào đối với URL ví dụ, sau đó xin hướng dẫn từ maintainer về việc chọn log ở mức info, thông tin chi tiết trong response hoặc cả hai. Hoàn tất khi hành vi được chọn giúp chẩn đoán việc từ chối ở mức logging mặc định hoặc trong response.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

enhancement module:blaze-server

I'll start explaining myself with an example. Let's say we deploy an http4s blaze server with info level logging. We then hit the server with a request for http://127.0.0.1:8080/foo?bar={} and get 400 in response. The response body is empty - no feedback there. The logs? No info there too. (for now, let's not discuss why this is a valid URL according to Firefox and Chrome and an invalid according to parboiled)

Switching logger level to debug, would give us the precious error message. But IMO using debug logs on production is not the way to go. I would like the problem to be diagnosable "by default", and the IMO info level is the "default" for production. So what can we do about it?

  1. This log could be an info level log.
  2. The response message could contain error information.

I can make a PR for one or both of these, but I would like to first hear your (maintainers'/community) opinion on that. Especially I would like to know which solution you would prefer.

Ngôn ngữ chính
Scala
Star
371
Fork
63
Merge trung bình
4 giờ 12 phút
Pull request đã merge (30 ngày)
5

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của http4s/blaze

Tất cả issue của http4s/blaze

Issue tương tự

Thêm issue về Scala

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.