Giter Site home page Giter Site logo

Comments (9)

chripo avatar chripo commented on July 17, 2024 1

sound good.
if you stuck, drop me i line an i'll try to help you.

from gowebdav.

chripo avatar chripo commented on July 17, 2024

thank you for the excellent bugreport.
at the moment i have no time left, to do some fixes.
your welcome to fix this issues.

from gowebdav.

RAYs3T avatar RAYs3T commented on July 17, 2024

I'll dig around a little on the weekend!

from gowebdav.

RAYs3T avatar RAYs3T commented on July 17, 2024

Okay, so i can confirm that the call invoking the request via the HTTP client indeed includes the correct file (with content).
if you look at the contents of the reader, the correct file is streamed.

image

This makes me think that this might be really an issue on Nextclouds site. But what I don't get is why the upload with cyberduck for example works. Maybe its something with the headers set...

from gowebdav.

chripo avatar chripo commented on July 17, 2024

does curl work?

from gowebdav.

chripo avatar chripo commented on July 17, 2024

@RAYs3T any progress?

from gowebdav.

RAYs3T avatar RAYs3T commented on July 17, 2024

Sorry for the late response. It seems like this is somehow involving the reverse proxy which you're using in your setup. Since I switched my nextcloud instance from apache2 to nginx and configured some extras, it's working fine.

Here the issue description: https://trac.cyberduck.io/wiki/help/en/howto/mount/issues/fastcgi

And this is what you have to configure in nginx photoprism/photoprism#443 (comment)

So this isn't an issue with the client - Maybe just how the error is handled.

from gowebdav.

pojntfx avatar pojntfx commented on July 17, 2024

I ran into this issue and I think I got to the bottom of it as well: reverse proxies which have issues with chunked encoding. In my case however, the target WebDAV server (a Nextcloud) can't be modified/the setup can't be changed, which blocked use of this library for me.

Anyways, to fix, I've added an interceptor to Client.put:

rs, err := c.req("PUT", path, stream, func(rq *http.Request) {
		b, err := ioutil.ReadAll(rq.Body)
		if err != nil {
			panic(err)
		}

		rq.ContentLength = int64(len(b))

		rq.Body = ioutil.NopCloser(bytes.NewReader(b))
	})

Using this, the upload works fine - I'll fork it for now. I'd recommend adding a Client.SetInterceptor func(interceptor func(method string, rq *http.Request)) API - I could create a PR if this would be an acceptable solution for those like me which are stuck without chunked encoding :)

from gowebdav.

pojntfx avatar pojntfx commented on July 17, 2024

@chripo I've prepared a PR which resolves this issue.

from gowebdav.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.