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

Http Method "OPTIONS" and security #163

Open
LeonardoGentile opened this issue Jan 29, 2016 · 0 comments
Open

Http Method "OPTIONS" and security #163

LeonardoGentile opened this issue Jan 29, 2016 · 0 comments
Assignees

Comments

@LeonardoGentile
Copy link

In rest_auth.registration.views the allowed methods are allowed_methods = ('POST', 'OPTIONS', 'HEAD'). Please notice that performing a request with OPTIONS method will return something like this

{
  "name": "Register",
  "description": "Accepts the credentials and creates a new user\nif user does not exist already\nReturn the REST Token if the credentials are valid and authenticated.\nCalls allauth complete_signup method\n\nAccept the following POST parameters: username, email, password\nReturn the REST Framework Token Object's key.",
  "renders": [
    "application/json",
    "text/html"
  ],
  "parses": [
    "application/json",
    "application/x-www-form-urlencoded",
    "multipart/form-data"
  ]
}

As you can see this returns a description of the endpoint (as OPTIONS is menat to be) but expose the docstring describing RegisterView in fact maybe telling the user much more than what it should know..

Reference: http://www.django-rest-framework.org/api-guide/metadata/

@nickatnight nickatnight self-assigned this Apr 19, 2019
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

No branches or pull requests

2 participants