{"action":"created","issue":{"url":"https://api.github.com/repos/ktorio/ktor/issues/697","repository_url":"https://api.github.com/repos/ktorio/ktor","labels_url":"https://api.github.com/repos/ktorio/ktor/issues/697/labels{/name}","comments_url":"https://api.github.com/repos/ktorio/ktor/issues/697/comments","events_url":"https://api.github.com/repos/ktorio/ktor/issues/697/events","html_url":"https://github.com/ktorio/ktor/issues/697","id":376836436,"node_id":"MDU6SXNzdWUzNzY4MzY0MzY=","number":697,"title":"enhance api for ConditionalHeaders usage","user":{"login":"kutoman","id":5825645,"node_id":"MDQ6VXNlcjU4MjU2NDU=","avatar_url":"https://avatars3.githubusercontent.com/u/5825645?v=4","gravatar_id":"","url":"https://api.github.com/users/kutoman","html_url":"https://github.com/kutoman","followers_url":"https://api.github.com/users/kutoman/followers","following_url":"https://api.github.com/users/kutoman/following{/other_user}","gists_url":"https://api.github.com/users/kutoman/gists{/gist_id}","starred_url":"https://api.github.com/users/kutoman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kutoman/subscriptions","organizations_url":"https://api.github.com/users/kutoman/orgs","repos_url":"https://api.github.com/users/kutoman/repos","events_url":"https://api.github.com/users/kutoman/events{/privacy}","received_events_url":"https://api.github.com/users/kutoman/received_events","type":"User","site_admin":false},"labels":[{"id":243686458,"node_id":"MDU6TGFiZWwyNDM2ODY0NTg=","url":"https://api.github.com/repos/ktorio/ktor/labels/problem","name":"problem","color":"cc317c","default":false}],"state":"open","locked":false,"assignee":{"login":"cy6erGn0m","id":762598,"node_id":"MDQ6VXNlcjc2MjU5OA==","avatar_url":"https://avatars3.githubusercontent.com/u/762598?v=4","gravatar_id":"","url":"https://api.github.com/users/cy6erGn0m","html_url":"https://github.com/cy6erGn0m","followers_url":"https://api.github.com/users/cy6erGn0m/followers","following_url":"https://api.github.com/users/cy6erGn0m/following{/other_user}","gists_url":"https://api.github.com/users/cy6erGn0m/gists{/gist_id}","starred_url":"https://api.github.com/users/cy6erGn0m/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cy6erGn0m/subscriptions","organizations_url":"https://api.github.com/users/cy6erGn0m/orgs","repos_url":"https://api.github.com/users/cy6erGn0m/repos","events_url":"https://api.github.com/users/cy6erGn0m/events{/privacy}","received_events_url":"https://api.github.com/users/cy6erGn0m/received_events","type":"User","site_admin":false},"assignees":[{"login":"cy6erGn0m","id":762598,"node_id":"MDQ6VXNlcjc2MjU5OA==","avatar_url":"https://avatars3.githubusercontent.com/u/762598?v=4","gravatar_id":"","url":"https://api.github.com/users/cy6erGn0m","html_url":"https://github.com/cy6erGn0m","followers_url":"https://api.github.com/users/cy6erGn0m/followers","following_url":"https://api.github.com/users/cy6erGn0m/following{/other_user}","gists_url":"https://api.github.com/users/cy6erGn0m/gists{/gist_id}","starred_url":"https://api.github.com/users/cy6erGn0m/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cy6erGn0m/subscriptions","organizations_url":"https://api.github.com/users/cy6erGn0m/orgs","repos_url":"https://api.github.com/users/cy6erGn0m/repos","events_url":"https://api.github.com/users/cy6erGn0m/events{/privacy}","received_events_url":"https://api.github.com/users/cy6erGn0m/received_events","type":"User","site_admin":false}],"milestone":null,"comments":3,"created_at":"2018-11-02T14:38:31Z","updated_at":"2018-11-09T11:01:30Z","closed_at":null,"author_association":"NONE","body":"sorry if there is already an appropriate way of doing this what I'm going to ask for. Since the documentation is lacking with respect to the usage of the `ConditionalHeaders` feature I coulnd't find a way of managing it concisely. \r\nAs far as I could see, in order to utilize `ConditionalHeaders` the `OutgoingContent`'s headers need to be set. Thus this here\r\n\r\n```\r\n// somewhere in installation phase\r\n    install(ContentNegotiation) {\r\n        register(ContentType.Application.Json, GsonConverter())\r\n    }\r\n    install(ConditionalHeaders)\r\n\r\n// somewhere in api call\r\nctx.call.response.header(HttpHeaders.LastModified, lastModifiedTime)\r\nctx.call.respond(HttpStatusCode.OK, anydata)\r\n```\r\n\r\ndon't have any effect since the header of the ApplicationResponse is set (instead of the content). \r\nTherefore when I use `ContentNegotiation` I would need to adapt the conversion process so that the produced OutgoingContent instances also contain the relevant headers which is imho against the concise api nature of ktor.\r\n\r\nwouldn't it make sense that ApplicationResponse headers are applied to the OutgoingContent headers?\r\n"},"comment":{"url":"https://api.github.com/repos/ktorio/ktor/issues/comments/437326342","html_url":"https://github.com/ktorio/ktor/issues/697#issuecomment-437326342","issue_url":"https://api.github.com/repos/ktorio/ktor/issues/697","id":437326342,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNzMyNjM0Mg==","user":{"login":"kutoman","id":5825645,"node_id":"MDQ6VXNlcjU4MjU2NDU=","avatar_url":"https://avatars3.githubusercontent.com/u/5825645?v=4","gravatar_id":"","url":"https://api.github.com/users/kutoman","html_url":"https://github.com/kutoman","followers_url":"https://api.github.com/users/kutoman/followers","following_url":"https://api.github.com/users/kutoman/following{/other_user}","gists_url":"https://api.github.com/users/kutoman/gists{/gist_id}","starred_url":"https://api.github.com/users/kutoman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kutoman/subscriptions","organizations_url":"https://api.github.com/users/kutoman/orgs","repos_url":"https://api.github.com/users/kutoman/repos","events_url":"https://api.github.com/users/kutoman/events{/privacy}","received_events_url":"https://api.github.com/users/kutoman/received_events","type":"User","site_admin":false},"created_at":"2018-11-09T11:01:30Z","updated_at":"2018-11-09T11:01:30Z","author_association":"NONE","body":"as a workaround I'll use this for the moment:\r\n\r\n    install(ContentNegotiation) {\r\n        register(ContentType.Application.Json, GsonConverter())\r\n    }\r\n\r\n    sendPipeline.intercept(ApplicationSendPipeline.Render) { subject ->\r\n        if(subject is OutgoingContent.ByteArrayContent) {\r\n            proceedWith(ContentWithResponseHeaders(subject, context.response.headers.allValues()))\r\n        }\r\n\r\n    }\r\n\r\n    install(ConditionalHeaders)"}}
{"actor":{"display_login":"kutoman"}}