apache / apache/trafficserver

Status mismatch in header_rewrite

Open
#11,397 3 comments 0 reactions 0 assignees View on GitHub
Documentation header_rewrite Stale
Dominant language
C++
Stars
2k
Forks
874
Avg merge
6d 15h
Merged PRs (30d)
46

Description

The status parsed through resources in the exec func of a header_rewrite config can be different to the status seen in headers.

e.g.
```
Config #1
cond %{READ_RESPONSE_HDR_HOOK}
cond %{STATUS} = 400
set-status 404

Config #2
cond %{READ_RESPONSE_HDR_HOOK}
cond %{STATUS} = 404
set-status 410

```
If config 1 is fired first, config 2 never runs. Despite the fact that config 1 changes the status, because all rules are evaluated once before execution, the change of status is not recognised by config 2.

https://github.com/apache/trafficserver/blob/b46f5d061af455dc75956346da3308788381b30d/plugins/header_rewrite/header_rewrite.cc#L306-L319

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.