Patchwork [1,of,2] lfs: avoid an improper usage of os.path.basename() to parse a URI

login
register
mail settings
Submitter Matt Harbison
Date April 1, 2018, 4 a.m.
Message ID <bdef5a344ebfd54cf454.1522555254@Envy>
Download mbox | patch
Permalink /patch/30097/
State Accepted
Headers show

Comments

Matt Harbison - April 1, 2018, 4 a.m.
# HG changeset patch
# User Matt Harbison <matt_harbison@yahoo.com>
# Date 1522554476 14400
#      Sat Mar 31 23:47:56 2018 -0400
# Node ID bdef5a344ebfd54cf454b184e14d0c37400f7547
# Parent  2ed180117f7658d0cbf6a1ece20944465c55c947
lfs: avoid an improper usage of os.path.basename() to parse a URI

Patch

diff --git a/hgext/lfs/wireprotolfsserver.py b/hgext/lfs/wireprotolfsserver.py
--- a/hgext/lfs/wireprotolfsserver.py
+++ b/hgext/lfs/wireprotolfsserver.py
@@ -10,7 +10,6 @@  from __future__ import absolute_import
 import datetime
 import errno
 import json
-import os
 
 from mercurial.hgweb import (
     common as hgwebcommon,
@@ -239,7 +238,7 @@  def _processbasictransfer(repo, req, res
     """
 
     method = req.method
-    oid = os.path.basename(req.dispatchpath)
+    oid = req.dispatchparts[-1]
     localstore = repo.svfs.lfslocalblobstore
 
     if method == b'PUT':