`isValidOrigin` cannot handle origin string with a port number

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

Maintainer thường phản hồi trong vòng 1 ngày

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

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
45/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
go
Lĩnh vực
api

Hướng nghiên cứu

Locate isValidOrigin and inspect its current url.Parse-based validation, then compare it with the linked Static CT API specification. Update the validation so an origin such as 127.0.0.1:8000 is accepted without a scheme while invalid origins remain rejected, and run the relevant existing tests if available.

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

Mô tả

bug

Description

An origin string like '127.0.0.1:8000' should be a valid submission prefix according to the specification. However, isValidOrigin returns an error, because it cannot parse it as a schema-less URL:

Can't initialize CT HTTP Server: newLog(): origin "127.0.0.1:8000" is not valid: can't parse origin as an URL: parse "127.0.0.1:8000": first path segment in URL cannot contain colon

Adding a schema prefix of course results in an error as well.

I think using url.Parse is not the best option for this validation check because it cannot recognize a URL that includes a non-standard port if the URL does not have a scheme.

Ngôn ngữ chính
Go
Star
41
Fork
20
Merge trung bình
1 ngày 21 giờ
Pull request đã merge (30 ngày)
26

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 transparency-dev/tesseract

Tất cả issue của transparency-dev/tesseract

Issue tương tự

Thêm issue về Go

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.