Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Case sensitivity of methods, and spec compliance #83

Open
Manishearth opened this issue May 9, 2014 · 2 comments
Open

Case sensitivity of methods, and spec compliance #83

Manishearth opened this issue May 9, 2014 · 2 comments

Comments

@Manishearth
Copy link
Contributor

While from_str in method.rs currently mentions that it is case insensitive, the code reads otherwise. This probably should be fixed.

Additionally, the rules for extension methods probably should match the token production given here, and fail or return None otherwise.

(I'll try my hand at this)

@Manishearth
Copy link
Contributor Author

The rules for a valid token for extension methods can use the following method on a Vec<u8>:

        vec.iter().all(|&x| {
            // http://tools.ietf.org/html/rfc2616#section-2.2
            match x {
                0..31 | 127 => false, // CTLs
                40 | 41 | 60 | 62 | 64 |
                44 | 59 | 58 | 92 | 34 |
                47 | 91 | 93 | 63 | 61 |
                123 | 125 | 32  => false, // separators
                _ => true
            }
        })
    }

@chris-morgan
Copy link
Owner

Actually, case sensitive was correct; the comment is the thing at fault.

I quite agree about ensuring that the parsing is done correctly; that’s something that should be fixed at the type level, really; in this one place is not optimal.

Frankly, I wouldn’t bother about changing these things; rust-http is in maintenance mode, with new work taking place on Teepee. There, such compliance is being taken seriously.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants