title: Django - Sending OPTIONS request second time will append body data to request method
body: <p>The issue is when there's content inside body with OPTIONS method, the second request will always fail with message <strong>Method Not Allowed</strong>. Printed the log and showed that the method became <code>"{"username":"test","password":"test"}POST /member/login/ HTTP/1.1" 405 111</code>. Problem is when the server has restarted, the first OPTIONS request will pass normally. Have tried with only POST and it works fine. Only OPTIONS has this issue.</p>
  
  <p>ENV details: python:3.6.5, django:2.1.3, drf:3.9.0, django-cors-headers:2.4.0</p>
  
  <p>views.py(Only show the decorations cause it didn't go inside the block):</p>
  
  <pre><code>@csrf_exempt
  @api_view(['POST'])
  @authentication_classes([])
  @permission_classes([AllowAny])
  def member_login(request):
      pass
  </code></pre>
  
  <p>middlewares:</p>
  
  <pre><code>MIDDLEWARE = [
      'corsheaders.middleware.CorsMiddleware',
      'django.middleware.security.SecurityMiddleware',
      'django.contrib.sessions.middleware.SessionMiddleware',
      'django.middleware.common.CommonMiddleware',
      'django.middleware.csrf.CsrfViewMiddleware',
      'django.contrib.auth.middleware.AuthenticationMiddleware',
      'django.contrib.messages.middleware.MessageMiddleware',
      'django.middleware.clickjacking.XFrameOptionsMiddleware',
  ]
  </code></pre>
  
  <p>Request method: <strong>OPTIONS</strong> and <strong>POST</strong></p>
  
  <p>Request header:</p>
  
  <pre><code>Content-Type: application/json
  Origin: http://google.com
  Access-Control-Request-Method: POST
  Access-Control-Request-Headers: X-PINGOTHER,Content-Type
  </code></pre>
  
  <p>Request body:</p>
  
  <pre><code>{"username":"superuser","password":"pass1234"}
  </code></pre>
  
  <p>After sending OPTIONS request for 2 times:</p>
  
  <pre><code>INFO 2018-12-25 02:26:03,585 "OPTIONS /member/login/ HTTP/1.1" 200 0
  WARNING 2018-12-25 02:26:10,180 Method Not Allowed: /member/login/
  WARNING 2018-12-25 02:26:10,182 "{"username":"superuser","password":"pass1234"}OPTIONS /member/login/ HTTP/1.1" 405 98
  </code></pre>
  
  <p>After getting error with method not allowed, cannot send any other request to the api. It will always return <strong>Method Not Allowed</strong> even it's the different method I'm using.</p>
  
  <pre><code>WARNING 2018-12-25 02:30:57,939 Method Not Allowed: /member/login/
  WARNING 2018-12-25 02:30:57,940 "{"username":"superuser","password":"pass1234"}POST /member/login/ HTTP/1.1" 405 95
  WARNING 2018-12-25 02:30:58,603 Method Not Allowed: /member/login/
  WARNING 2018-12-25 02:30:58,603 "{"username":"superuser","password":"pass1234"}POST /member/login/ HTTP/1.1" 405 95
  WARNING 2018-12-25 02:30:59,684 Method Not Allowed: /member/login/
  WARNING 2018-12-25 02:30:59,685 "{"username":"superuser","password":"pass1234"}POST /member/login/ HTTP/1.1" 405 95
  </code></pre>
  
  <p>Tried with the older version of Django. This issue didn't happen.</p>