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

[BUG: Web API V2.1 Rename File Error] #2238

Closed
yomige opened this issue Aug 29, 2019 · 0 comments
Closed

[BUG: Web API V2.1 Rename File Error] #2238

yomige opened this issue Aug 29, 2019 · 0 comments

Comments

@yomige
Copy link

yomige commented Aug 29, 2019

I try the Rename File Interface on this page : https://download.seafile.com/published/web-api/v2.1/file.md . It can rename a file success, but it returns a wrong 301 .

[inspur@localhost conf]$ curl -v -d "operation=rename&newname=about.txt" -H 'Authorization: Token 0f075998c939b3e38cacc8cacd4068bf03da9b9f' -H 'Accept: application/json; charset=utf-8; indent=4' http://10.47.0.172:8000/api2/repos/7f178180-27e3-4f97-b4b1-7f720795938a/file/?p=/Documents/readme.txt
* About to connect() to 10.47.0.172 port 8000 (#0)
*   Trying 10.47.0.172...
* Connected to 10.47.0.172 (10.47.0.172) port 8000 (#0)
> POST /api2/repos/7f178180-27e3-4f97-b4b1-7f720795938a/file/?p=/Documents/readme.txt HTTP/1.1
> User-Agent: curl/7.29.0
> Host: 10.47.0.172:8000
> Authorization: Token 0f075998c939b3e38cacc8cacd4068bf03da9b9f
> Accept: application/json; charset=utf-8; indent=4
> Content-Length: 34
> Content-Type: application/x-www-form-urlencoded
> 
* upload completely sent off: 34 out of 34 bytes
< HTTP/1.1 301 Moved Permanently
< Server: gunicorn/19.8.1
< Date: Thu, 29 Aug 2019 06:48:07 GMT
< Connection: close
< Content-Length: 9
< Content-Language: en
< Vary: Accept, Accept-Language, Cookie
< Location: http://10.47.0.172:8000/api2/repos/7f178180-27e3-4f97-b4b1-7f720795938a/file/?p=/Documentsabout.txt
< Allow: GET, POST, PUT, DELETE, HEAD, OPTIONS
< Content-Type: application/json; charset=utf-8; indent=4
< 
* Closing connection 0

Location should be "Location: http://10.47.0.172:8000/api2/repos/7f178180-27e3-4f97-b4b1-7f720795938a/file/?p=/Documents/about.txt " not "Location: http://10.47.0.172:8000/api2/repos/7f178180-27e3-4f97-b4b1-7f720795938a/file/?p=/Documentsabout.txt" .

@yomige yomige changed the title [Web API V2.1 Rename File Error] [BUG: Web API V2.1 Rename File Error] Aug 29, 2019
@killing killing closed this as completed Sep 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants