aws-samples / aws-samples/aws-lambda-redirection-at-edge

Document and code doesnt work as expected

Đang mở
#7 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
JavaScript
Star
46
Fork
15
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

Following this guide:
https://aws.amazon.com/blogs/networking-and-content-delivery/handling-redirectsedge-part2/

Recommends a JSON like this one:
```
{
"uris":[
{
"original":"/index1.html",
"redirect":"/index2.html?test=1",
"statusCode":"302",
"startTime":"2017-10-23T13:15",
"endTime":""
}],
"wildcards":[
{
"original":"/index6/*",
"redirect":"/index7/*",
"statusCode":"301",
"startTime":"2017-10-23T01:01",
"endTime":"2017-10-25T01:01"
}],
"querystrings":[
{
"original":"campaign=1",
"redirect":"/index4.html?test",
"statusCode":"301",
"startTime":"",
"endTime":""
}]
}
```

But that json is wrong,
Two possible options:

1) Change the json in the doc to modify the "uris" key and name it "rules"

2) Change the code so in this line:
https://github.com/aws-samples/aws-lambda-redirection-at-edge/blob/73b0876351679adc63b1d245b56a990c05c19081/lambda/origin-request-function/rules.js#L31

rename from:
```
this.ruleset.rules
to
this.ruleset.uris
```

Other than that, thanks for this example :D

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Start by comparing the JSON example in the linked AWS guide with lambda/origin-request-function/rules.js at line 31, where the ruleset key is read. Decide which key should be authoritative, update the documentation or code consistently, and verify that the sample configuration is accepted and used by the redirect handler.

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

Đánh giá

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

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.