Skip to content

Commit

Permalink
fix docstring for corsmiddleware
Browse files Browse the repository at this point in the history
  • Loading branch information
vaibhavmule committed Jun 8, 2019
1 parent 97ac2cd commit 7e41cbc
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions masonite/middleware/CorsMiddleware.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,25 @@
""" CORS Middleware """
"""CORS Middleware."""

from masonite.helpers import config
from masonite.request import Request


class CorsMiddleware:
"""Appends CORS headers to HTTP response
"""Appends CORS headers to HTTP response.
Put any CORS middleware you need as a CORS dictionary inside your
middleware config file.
Put any CORS middleware you need as a CORS dictionary inside your
middleware config file.
"""

def __init__(self, request: Request):
"""Inject Any Dependencies From The Service Container
"""Inject Any Dependencies From The Service Container.
Arguments:
Request {masonite.request.Request} -- The Masonite request object
"""
self.request = request

def after(self):
"""Run This Middleware After The Route Executes
"""
"""Run This Middleware After The Route Executes."""
headers = config('middleware.cors') or {}
self.request.header(headers)

0 comments on commit 7e41cbc

Please sign in to comment.