Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implement workaround for chi.RegisterMethod #3662

Merged
merged 1 commit into from
May 3, 2022

Conversation

C0rby
Copy link
Contributor

@C0rby C0rby commented May 3, 2022

Description

Implement a workaround for chi.RegisterMethod for the webdav search.

Related Issue

Motivation and Context

chi.RegisterMethod writes to a global map. Other parts of chi read that map and since we start multiple chi router in different goroutines we concurrently read/write to the map which is not valid and results in panics

How Has This Been Tested?

  • test environment: locally via curl
curl -X REPORT -k https://localhost:9200/remote.php/dav/files/admin -i -u 'admin:.AT*+DatuZlfO!QS@TAyF5#EKz68fd0%'
HTTP/1.1 400 Bad Request
Cache-Control: no-cache, no-store, max-age=0, must-revalidate, value
Content-Length: 209
Content-Security-Policy: frame-ancestors 'none'
Content-Type: application/xml; charset=utf-8
Date: Tue, 03 May 2022 14:37:50 GMT
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Last-Modified: Tue, 03 May 2022 14:37:50 GMT
Vary: Origin
X-Content-Type-Options: nosniff
X-Frame-Options: DENY
X-Webdav-Version: 1a0e55cc7

<?xml version="1.0" encoding="UTF-8"?>
<d:error xmlns:d="DAV" xmlns:s="http://sabredav.org/ns"><s:exception>Sabre\DAV\Exception\BadRequest</s:exception><s:message>missing search-files tag</s:message></d:error

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • Code changes

chi.RegisterMethod writes to a global map. Other parts of chi read that map and since we start multiple chi router in different goroutines we concurrently read/write to the map which is not valid and results in panics
@C0rby C0rby self-assigned this May 3, 2022
@update-docs
Copy link

update-docs bot commented May 3, 2022

Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes.

@sonarqubecloud
Copy link

sonarqubecloud bot commented May 3, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@C0rby C0rby merged commit a29d202 into master May 3, 2022
@delete-merged-branch delete-merged-branch bot deleted the workaround-chi-registermethod branch May 3, 2022 15:26
ownclouders pushed a commit that referenced this pull request May 3, 2022
Merge: 4b70484 618e6a6
Author: David Christofas <dchristofas@owncloud.com>
Date:   Tue May 3 17:26:40 2022 +0200

    Merge pull request #3662 from owncloud/workaround-chi-registermethod

    implement workaround for chi.RegisterMethod
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants