owncloud / owncloud/ocis

[BUG] `/app/new` endpoint returns 403 for wrong cases

Open
#6,140 0 comments 0 reactions 0 assignees View on GitHub
Type:Bug
Dominant language
Go
Stars
2.1k
Forks
274
Avg merge
2d 1h
Merged PRs (30d)
103

Description

## Describe the bug

The endpoint `/app/new` is returning 403 HTTP code for several wrong cases I could test, such as creating a file with a name that already exists. This error code means "forbidden" and is related with permissions AFAIK, so this shouldn't be the error that the server returns. In the case of the creation of a new folder, when trying to create a folder with a name that already exists, the server returns a 405, which means "method not allowed", and it allows to handle it properly from the different clients (in my case from the Android app).

## Steps to reproduce

Steps to reproduce the behavior:

1. Create a new file with the `/app/new` endpoint
2. Set a filename that already exists in that folder
3. 403 is returned by the server

## Expected behavior
Server returns 405 or any other error that allows us to handle separately from the lack-of-permissions error, 403.

## Actual behavior
Server returns 403 error.

## Setup

I'm using [ocis.ocis-wopi.latest.owncloud.works](https://ocis.ocis-wopi.latest.owncloud.works/) to test this.

## Additional context

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.