Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Frame header parsing error #1

Open
GoogleCodeExporter opened this issue Mar 30, 2015 · 1 comment
Open

Frame header parsing error #1

GoogleCodeExporter opened this issue Mar 30, 2015 · 1 comment

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. send header with any key and a value of a url http://

What is the expected output?
A pair of strings

What do you see instead?
An error.

What version of the product are you using? On what operating system?
Latest and ubuntu

Please provide any additional information below.
This is my fix for it but im sure there is quicker way todo it :)

stomp_frame.erl

parse_headers([]) -> [];
parse_headers([HeaderText | Others]) ->
    case re:run(HeaderText, "^(?<key>[a-z0-9])(\s)?\:(\s)?(?<val>.+)", [{capture, [key, val], list}]) of
        nomatch ->
            Tokens = string:tokens(HeaderText, ":"),
            Pair = to_pair(Tokens),
            [Pair | parse_headers(Others)];
        {match,[K,V]} ->
            Pair = to_pair([K,V]),
            [Pair | parse_headers(Others)]
    end.


Original issue reported on code.google.com by davem.2...@gmail.com on 24 Feb 2014 at 2:49

@GoogleCodeExporter
Copy link
Author

BTW i have been using this library for quite a while and have found it to be 
very fast and efficient i could not imagine myself using anything else :)

Original comment by davem.2...@gmail.com on 24 Feb 2014 at 2:53

  • Added labels: ****
  • Removed labels: ****

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

No branches or pull requests

1 participant