-
Notifications
You must be signed in to change notification settings - Fork 2.1k
feature: expose the 'Last-Modified' response header as ngx.header["Last-Modified"]. #1983
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| values[0].data = p; | ||
| values[0].len = ngx_http_time(p, last_modified) - p; | ||
| return 1; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there should be a blank line before the break;
| values[0].data = p; | ||
| values[0].len = ngx_http_time(p, last_modified) - p; | ||
| return 1; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we can return 0 here when the last_modified < 0? just for better performance.
src/ngx_http_lua_headers.c
Outdated
| break; | ||
|
|
||
| case 13: | ||
| last_modified = r->headers_out.last_modified_time; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should check if the key_buf is Last-Modified-time?
a97c90c to
6ceb395
Compare
t/016-resp-header.t
Outdated
|
|
||
|
|
||
|
|
||
| === TEST 96: Expose the 'Last-Modified' response header as ngx.header["Last-Modified"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
duplicated test name, better use a unique one.
Do you want to test the header is not existing?
src/ngx_http_lua_headers.c
Outdated
|
|
||
| case 13: | ||
| if (ngx_strncasecmp(key_buf, (u_char *) "Last-Modified", 13) == 0) { | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: useless blank line.
I hereby granted the copyright of the changes in this pull request
to the authors of this lua-nginx-module project.
the original PR is #1384.
the ngx.header was rewrite via ffi. So need to rewrite this feature.