Stored cached responses ignore non 200 status codes
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 68/100
Hướng nghiên cứu
Start by tracing how the cache stores a response and restores it on a cache hit; the issue does not name implementation files or tests. Check where the original status code is preserved and compare the first response with the cached response in the reproducer. Done means cached 203 and 206 responses retain their status codes; add or update a regression test for a cached 206 response.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Version
5.x and 4.x
Context
Stored response upon HIT always override status code to 200. That is a problem for other successful cached responses (e.g. 203 and 206).
Steps to reproduce
JBang reproducer:
///usr/bin/env jbang "$0" "$@"
//DEPS io.vertx:vertx-core:5.2.0
//DEPS io.vertx:vertx-http-proxy:5.2.0
//DEPS io.vertx:vertx-web-client:5.2.0
import io.vertx.core.Vertx;
import io.vertx.core.http.HttpHeaders;
import io.vertx.ext.web.client.WebClient;
import io.vertx.httpproxy.HttpProxy;
import io.vertx.httpproxy.ProxyOptions;
import io.vertx.httpproxy.cache.CacheOptions;
public class cache_206_bug {
public static void main(String[] args) throws Exception {
Vertx vertx = Vertx.vertx();
vertx.createHttpServer()
.requestHandler(req -> req.response()
.setStatusCode(206)
.putHeader(HttpHeaders.CACHE_CONTROL, "public, max-age=3600")
.putHeader(HttpHeaders.CONTENT_RANGE, "bytes 0-99/1000")
.putHeader(HttpHeaders.CONTENT_TYPE, "video/mp4")
.end("partial content"))
.listen(8081)
.await();
HttpProxy proxy = HttpProxy.reverseProxy(
new ProxyOptions().setCacheOptions(new CacheOptions()),
vertx.createHttpClient()).origin(8081, "localhost");
vertx.createHttpServer()
.requestHandler(proxy)
.listen(8080)
.await();
WebClient client = WebClient.create(vertx);
var resp1 = client.get(8080, "localhost", "/video").send().await();
System.out.println("Request 1 Status: " + resp1.statusCode()); // returns 206
Thread.sleep(1000);
var resp2 = client.get(8080, "localhost", "/video").send().await();
System.out.println("Request 2 Status: " + resp2.statusCode()); // returns 200, should be 206
vertx.close().await();
}
}
Do you have a reproducer?
No response
- Ngôn ngữ chính
- Java
- Star
- 68
- Fork
- 39
- Merge trung bình
- 2 ngày 43 phút
- Pull request đã merge (30 ngày)
- 5
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của eclipse-vertx/vertx-http-proxy
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
enhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 56/100
-
ExceptionHandler for send requests and proxy responses in `HttpProxy`/`ReverseProxy`Có thể làm lại được @tsegismont đã nhận 574 ngày trước và không có pull request nào đang mở. Đang mởenhancement
eclipse-vertx/vertx-http-proxy#114 · 2 bình luận · 1 người được giao ·
-
enhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 30/100
eclipse-vertx/vertx-http-proxy#109 · 5 bình luận ·
-
Silent failure to send backend request after authentication with OAuth2Có thể làm lại được @tsegismont đã nhận 725 ngày trước và không có pull request nào đang mở. Đang mởbug
eclipse-vertx/vertx-http-proxy#101 · 5 bình luận · 1 người được giao ·
Tất cả issue của eclipse-vertx/vertx-http-proxy
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
apache/rocketmq-dashboard#7302 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
area: android good first issue help wanted testing
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Gautam-aman/ResQNet#56 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation hermes-queue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
chrisalunlloyd2-sudo/mindpalace#294 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
better night vision compatĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
QuicksilverMC/Argentum#31 ·