Skip to content

Error in parsing lock token #9

@lscorcia

Description

@lscorcia

The lock token is emitted as (urn:uuid:[GUID]), but later it is parsed as if it were (<[GUID]>).

In file WebDavExtensions.cs, the method GetLockTokenIfHeader should be changed as follows:

public static Guid? GetLockTokenIfHeader(this IHttpListenerRequest request)
{
	if (!request.Headers.AllKeys.Contains("If"))
		return null;

	string ifHeaderValue = request.Headers["If"];
	int posLastColon = ifHeaderValue.LastIndexOf(':');
	int posUrnClose = ifHeaderValue.IndexOf('>');
	string t = ifHeaderValue.Substring(posLastColon + 1, posUrnClose - posLastColon - 1);
	return new Guid(t);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions