{"action":"created","issue":{"url":"https://api.github.com/repos/SmingHub/Sming/issues/678","repository_url":"https://api.github.com/repos/SmingHub/Sming","labels_url":"https://api.github.com/repos/SmingHub/Sming/issues/678/labels{/name}","comments_url":"https://api.github.com/repos/SmingHub/Sming/issues/678/comments","events_url":"https://api.github.com/repos/SmingHub/Sming/issues/678/events","html_url":"https://github.com/SmingHub/Sming/pull/678","id":145524522,"number":678,"title":"small additions for http server","user":{"login":"patrickjahns","id":6403243,"avatar_url":"https://avatars.githubusercontent.com/u/6403243?v=3","gravatar_id":"","url":"https://api.github.com/users/patrickjahns","html_url":"https://github.com/patrickjahns","followers_url":"https://api.github.com/users/patrickjahns/followers","following_url":"https://api.github.com/users/patrickjahns/following{/other_user}","gists_url":"https://api.github.com/users/patrickjahns/gists{/gist_id}","starred_url":"https://api.github.com/users/patrickjahns/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/patrickjahns/subscriptions","organizations_url":"https://api.github.com/users/patrickjahns/orgs","repos_url":"https://api.github.com/users/patrickjahns/repos","events_url":"https://api.github.com/users/patrickjahns/events{/privacy}","received_events_url":"https://api.github.com/users/patrickjahns/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-04-03T18:05:09Z","updated_at":"2016-04-04T22:55:45Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/SmingHub/Sming/pulls/678","html_url":"https://github.com/SmingHub/Sming/pull/678","diff_url":"https://github.com/SmingHub/Sming/pull/678.diff","patch_url":"https://github.com/SmingHub/Sming/pull/678.patch"},"body":"- allow for setting custom response codes / messages \r\n  The respond messages provided with sming are limited to a small amount, this allows for setting a custom / non-provided response code and makes the webserver more versatile\r\n\r\n- return Content-Length header field for files, json and memory messages  \r\n  It is recommended practice for http-server to also return a content-length as response\r\n\r\nUnfortunatly I haven`t found a way to create a buffer-length with the template method - any hints or ideas and I will try to also include this"},"comment":{"url":"https://api.github.com/repos/SmingHub/Sming/issues/comments/205532886","html_url":"https://github.com/SmingHub/Sming/pull/678#issuecomment-205532886","issue_url":"https://api.github.com/repos/SmingHub/Sming/issues/678","id":205532886,"user":{"login":"patrickjahns","id":6403243,"avatar_url":"https://avatars.githubusercontent.com/u/6403243?v=3","gravatar_id":"","url":"https://api.github.com/users/patrickjahns","html_url":"https://github.com/patrickjahns","followers_url":"https://api.github.com/users/patrickjahns/followers","following_url":"https://api.github.com/users/patrickjahns/following{/other_user}","gists_url":"https://api.github.com/users/patrickjahns/gists{/gist_id}","starred_url":"https://api.github.com/users/patrickjahns/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/patrickjahns/subscriptions","organizations_url":"https://api.github.com/users/patrickjahns/orgs","repos_url":"https://api.github.com/users/patrickjahns/repos","events_url":"https://api.github.com/users/patrickjahns/events{/privacy}","received_events_url":"https://api.github.com/users/patrickjahns/received_events","type":"User","site_admin":false},"created_at":"2016-04-04T22:55:45Z","updated_at":"2016-04-04T22:55:45Z","body":"@hreintke \r\n\r\nI didn`t know that we can call multiple sendstring instances and they will concatenated - will need to give this some more thoughts.\r\n\r\nWhat do you mean by: \r\n\r\n> With Sendfile we duplicate the sendHeader, should we make that one ?\r\n\r\nDid you mean `setHeader`?\r\n\r\n\r\nI am not to familiar with the stream objects - so I for clarification: is the length of the stream generally known before the first (body) packet is sent? \r\nI am not sure if `HttpServer::ProcessRequest` is a good place to intercept - I had a look and would suggest then `HttpResponse::sendHeader` for a more general approach? \r\n\r\nThe Content-Length needs to be returned in the Header and the latest we can set it, would be just before/while we sent the header? \r\n\r\nSince this turns out to be a bit more work for Content-Length, should I split the PR for custom statuscodes and Content-Length?"}}