Repository navigation
Conversation
parseStat split the propstat status line into three fields, so any reason phrase longer than one word lost its tail in the error message: "HTTP/1.1 404 Not Found" became "Invalid response: 404 Not", and the "HTTP/1.1 425 TOO EARLY" that OpenCloud and oCIS return for a file that is still in post-processing became "Invalid response: 425 TOO", which is how it reached users of clients built on this library. Split on every space and join the rest back, and trim the message when a server sends no reason phrase at all.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #417.
parseStatsplit the propstat status line into three fields, so any reason phrase longer than one word lost its tail in the error message:HTTP/1.1 404 Not FoundbecameInvalid response: 404 Not, and theHTTP/1.1 425 TOO EARLYthat OpenCloud and oCIS return for a file still in post-processing becameInvalid response: 425 TOO, which is the string users of clients built on this library have been reporting (remotely-save/remotely-save#1164, opencloud-eu/opencloud#3475).The change splits on every space and joins the remainder back as the reason phrase, and trims the message when a server sends no reason phrase at all (that case used to read
404 undefined).err.statusis unchanged.Tests: one on the existing
nginx-not-foundfixture asserting the fullInvalid response: 404 Not Found, and one on a newpropfind-too-earlyfixture shaped like the OpenCloud/oCIS response, assertingstatus === 425andInvalid response: 425 TOO EARLY. Both fail on master with exactly the truncated strings and pass with the change.npm run test:node(134 tests),test:types(4),test:web(27) andtest:formatpass locally.