diff options
author | Shawn O. Pearce <spearce@spearce.org> | 2012-03-07 19:51:12 -0800 |
---|---|---|
committer | Shawn O. Pearce <spearce@spearce.org> | 2012-03-07 19:51:12 -0800 |
commit | c1ed9483ff77487b38587a96a74b6ebb813985da (patch) | |
tree | 6237bbd19e6e90e022edb44d75291f54c83f6688 /org.eclipse.jgit.http.server/src | |
parent | 500e17e7d6d3c29cef0fd4651dc1cd29d7d0b8e6 (diff) | |
download | jgit-c1ed9483ff77487b38587a96a74b6ebb813985da.tar.gz jgit-c1ed9483ff77487b38587a96a74b6ebb813985da.zip |
Use readString() to trim trailing LF from first line
The fetch-pack/upload-pack stream usually has an LF at the
end of the first "want" line. Trim this when checking to
see if side-band or side-band-64k was used.
Perform the same trim for send-pack/receive-pack, as it is
harmless in this context to ignore an LF just before doing
an error report.
Change-Id: I6ef946bb6124fa72c52bd5320187eaac3ed906e7
Diffstat (limited to 'org.eclipse.jgit.http.server/src')
-rw-r--r-- | org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/GitSmartHttpTools.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/GitSmartHttpTools.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/GitSmartHttpTools.java index e6b287ff06..ab4d0da345 100644 --- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/GitSmartHttpTools.java +++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/GitSmartHttpTools.java @@ -245,7 +245,7 @@ public class GitSmartHttpTools { // capability and are expecting a response in the sideband, but we might // not have an UploadPack, or it might not have read any of the request. // So, cheat and read the first line. - String line = new PacketLineIn(req.getInputStream()).readStringRaw(); + String line = new PacketLineIn(req.getInputStream()).readString(); UploadPack.FirstLine parsed = new UploadPack.FirstLine(line); return (parsed.getOptions().contains(OPTION_SIDE_BAND) || parsed.getOptions().contains(OPTION_SIDE_BAND_64K)); @@ -285,7 +285,7 @@ public class GitSmartHttpTools { // capability and are expecting a response in the sideband, but we might // not have a ReceivePack, or it might not have read any of the request. // So, cheat and read the first line. - String line = new PacketLineIn(req.getInputStream()).readStringRaw(); + String line = new PacketLineIn(req.getInputStream()).readString(); ReceivePack.FirstLine parsed = new ReceivePack.FirstLine(line); return parsed.getCapabilities().contains(CAPABILITY_SIDE_BAND_64K); } catch (IOException e) { |