Re:Scala – 1 Star – Would Not Program Again
by chrismorgan on Sunday December 01, 2013 @08:17PM
(#6830541)
At present, in rust-http, invalid values will be dropped; that will be changing so that you can retrieve a bad header value (https://github.com/chris-morgan/rust-http/issues/27). Writing invalid HTTP, on the other hand, is something that I'm in two minds about. You shouldn't be allowed to do it, but it may be necessary somewhere along the way. At present, you can write invalid headers through the use of the extension headers—`response.headers.extension.set(~"Date", ~"invalid")`, for example. I certainly don't want to advertise it broadly, but I'm thinking guaranteeing that that will always work is perhaps the best plan.
[ Parent
| on HN ]
Re:Scala – 1 Star – Would Not Program Again
by zaphar on Sunday December 01, 2013 @09:16PM
(#6830951)
The author isn't wanting to write invalid headers. He's wanting to write perfectly valid headers that the framework he's using didn't allow him to write.
When the framework treats a a valid http header as invalid the framework is probably using the wrong abstraction for http headers.
Re:Scala – 1 Star – Would Not Program Again
by ethzero on Sunday December 01, 2013 @09:36PM
(#6831081)
Spray allows you to define custom (even invalid) headers, all you have to do is subclass HttpHeader. I'm sure the author knew this, but it's not obvious from his criticism.
Re:Scala – 1 Star – Would Not Program Again
by timtadh on Sunday December 01, 2013 @08:36PM
(#6830648)
You should always allow the user to get the raw HTTP request. Sometimes things just get funky and you need to drop down to that level. Abstraction is nice except when it isn't, if you understand my meaning.