feat(lander): remove content-disposition header
parent
e438bd045c
commit
dc0a3a7349
|
@ -23,6 +23,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
* Landerctl
|
||||
* `-c` flag to use custom config file (useful for testing)
|
||||
|
||||
## Changed
|
||||
|
||||
* Removed Content-Disposition header for files
|
||||
|
||||
## [0.2.0](https://git.rustybever.be/Chewing_Bever/lander/src/tag/0.2.0)
|
||||
|
||||
### Added
|
||||
|
|
|
@ -93,22 +93,6 @@ lnm_http_step_err lander_get_file(lnm_http_conn *conn) {
|
|||
lander_attr_to_header(ctx, lander_attr_type_content_type,
|
||||
lnm_http_header_content_type);
|
||||
|
||||
lsm_str *value;
|
||||
char *buf;
|
||||
|
||||
if (lsm_entry_attr_get(&value, c_ctx->entry, lander_attr_type_file_name) ==
|
||||
lsm_error_ok) {
|
||||
buf = malloc(24 + lsm_str_len(value));
|
||||
int len = lsm_str_len(value);
|
||||
sprintf(buf, "attachment; filename=\"%.*s\"", len, lsm_str_ptr(value));
|
||||
} else {
|
||||
buf = malloc(11);
|
||||
strcpy(buf, "attachment");
|
||||
}
|
||||
|
||||
lnm_http_res_add_header(&ctx->res, lnm_http_header_content_disposition, buf,
|
||||
true);
|
||||
|
||||
return lnm_http_step_err_done;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue