Forráskód Böngészése

Exclude Authorization header from openapi specs. (#714)

In addition to the existing 2 headers, the Authorization header is also
not allowed. Instead it is taken care of by the security schemes
Jan Stolle 1 éve
szülő
commit
ce566d44b0
1 módosított fájl, 1 hozzáadás és 1 törlés
  1. 1 1
      src/Writing/OpenAPISpecWriter.php

+ 1 - 1
src/Writing/OpenAPISpecWriter.php

@@ -177,7 +177,7 @@ class OpenAPISpecWriter
 
         if (count($endpoint->headers)) {
             foreach ($endpoint->headers as $name => $value) {
-                if (in_array($name, ['Content-Type', 'content-type', 'Accept', 'accept']))
+                if (in_array(strtolower($name), ['content-type', 'accept', 'authorization']))
                     // These headers are not allowed in the spec.
                     // https://swagger.io/docs/specification/describing-parameters/#header-parameters
                     continue;