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

Directory Listing Payload #30

Open
njh opened this issue May 26, 2017 · 6 comments
Open

Directory Listing Payload #30

njh opened this issue May 26, 2017 · 6 comments

Comments

@njh
Copy link
Owner

njh commented May 26, 2017

The current directory listing code has an example owserver response payload of:

var payloadResult = '/01.A7F1D92A82C8\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0011\u0000\u0000\u0000\u0000\u0000\u0000\u0000 \u0000\u0000\u0000\u0010\u0000\u0000\u0000\u0000/10.D8FE434D9855\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0011\u0000\u0000\u0000\u0000\u0000\u0000\u0000 \u0000\u0000\u0000\u0010\u0000\u0000\u0000\u0000/22.8CE2B3471711\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0011\u0000\u0000\u0000\u0000\u0000\u0000\u0000 \u0000\u0000\u0000\u0010\u0000\u0000\u0000\u0000/29.98542F112D05\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000 \u0000\u0000\u0000\u0000\u0000\u0000';

I have never seen anything like this in a real-world situation. And from reading the protocol documentation - I can't se how it is a valid response.

@colinl have you ever seen anything like this in the payload field?

If not, I think I will remove the code and tests that handle this.
I have a feeling that it was due to a bug elsewhere in the code.

@colinl
Copy link
Contributor

colinl commented May 26, 2017

I have not actually used it for getting a directory listing, but I can't see why it would look like that.

@colinl
Copy link
Contributor

colinl commented May 26, 2017

I suspect the binary stuff is additional headers interspersed between payloads, so caused by the bug in issue #26.

@njh
Copy link
Owner Author

njh commented May 30, 2017

Yes, I agree with you @colinl - it looks just like additional headers. I am going to simplify the code and test but then should probably do some testing with hardware before making another release.

@colinl
Copy link
Contributor

colinl commented May 30, 2017

Which code in particular do you think can be simplified?

@njh
Copy link
Owner Author

njh commented May 30, 2017

This strips out any characters in the range 0x00 - 0x1F:

var exp = new RegExp('[\u0000-\u001F]', 'g')

I am going to change it to just remove a trailing NULL.

@colinl
Copy link
Contributor

colinl commented May 30, 2017

Ah right, I am with you now. I think you are correct, the fix for #26 should stop the headers from being there at that point in the code. Which is what I already said a few days ago, I am getting old.

njh added a commit that referenced this issue May 30, 2017
…30)

standard.js: No control characters in regular expressions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants