-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
docker-srs:3 cannot obtain return value when using http-api for authentication with srs, authentication fails #1508
Comments
I have no problem trying it under srs2
|
SRS3 cannot be reproduced, the information you provided is too limited, please kindly describe it again following the bug template. Make sure to maintain the markdown structure. Configuration: Make sure to maintain the markdown structure.
Docker startup: Make sure to maintain the markdown structure.
Streaming: Make sure to maintain the markdown structure.
Success, the log is as follows: Make sure to maintain the markdown structure.
|
Can you please use Wireshark to capture the packets? I want to see the request and response. The problem cannot be reproduced on my end, so I need to reproduce it in order to identify the issue.
|
I encountered this problem when the interface you wrote did not include Content-Length in the response header.
|
What are the details of the headers when there is no Content-Length? What is the data format? Can it be captured using Wireshark? Or can you explain how your server code is written?
|
👍 Understood, it's chunked encoding. Let me check if SRS3 has any issues with this encoding.
|
Thank you very much. It turns out that this is indeed the problem. Adding content-length allows the streaming to be successful, but if the content-length is too large, it will wait for a timeout. Setting it to 1 can pass the validation!
|
Already confirmed, SRS3 fails to read chunked response. The TestCase is as follows:
|
SRS2 is not a problem because it uses header_parsed, but there is an issue with the assignment of this value. It is necessary to read and parse all the headers before it can be accurate, as referenced in Line#1023. Therefore, in the improved SRS3, parsing starts as soon as a bit is received, and this method cannot be used anymore. After the header is completed, the actual starting point of the body should be identified.
|
3.0.76, please try again. If it doesn't work, you can reopen this issue. If it is resolved, please let me know.
|
Hello, I tested it yesterday and as @vinsonws mentioned, adding content-length in the API validation can pass the verification. So, now we can also use it for authentication!
|
Okay👍. Can you please test with the new version to see if it can be validated without content-length?
|
Hello, last night I tested the latest version and it still cannot pass the validation without content-length!
|
Okay, I will set up an environment and give it a try today.
|
I built a Go API server that returns chunked encoding. It has been tested without any issues.
During debugging, it was discovered that the response is in chunked encoding and does not have a content-length.
Could you please try again and see if 3.0.80 is available now?
|
Using the latest docker-srs:3, I found that when using http-api for authentication, even though the http request status code is 200 and the returned value is 0, I cannot retrieve the returned value from the logs of srs, it is empty. Therefore, the authentication cannot pass. However, I can successfully retrieve the returned value by using Postman to request my own API!
TRANS_BY_GPT3
The text was updated successfully, but these errors were encountered: