-
-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #640 from MasoniteFramework/master
Next Minor
- Loading branch information
Showing
20 changed files
with
179 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
"""Module for specifying the Masonite version in a central location.""" | ||
|
||
VERSION = '2.1.22' | ||
VERSION = '2.1.23' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
""" CORS Middleware """ | ||
|
||
from masonite import env | ||
from masonite.helpers import config | ||
from masonite.request import Request | ||
|
||
|
||
class CorsMiddleware: | ||
"""Appends CORS headers to HTTP response | ||
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 | ||
Arguments: | ||
Request {masonite.request.Request} -- The Masonite request object | ||
""" | ||
self.request = request | ||
|
||
def after(self): | ||
"""Run This Middleware After The Route Executes | ||
""" | ||
headers = config('middleware.cors') or {} | ||
self.request.header(headers) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
from .CsrfMiddleware import CsrfMiddleware | ||
from .CorsMiddleware import CorsMiddleware | ||
from .MaintenanceModeMiddleware import MaintenanceModeMiddleware | ||
from .ResponseMiddleware import ResponseMiddleware | ||
from .SecureHeadersMiddleware import SecureHeadersMiddleware |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,18 @@ | ||
""" A {{ class }} Module """ | ||
"""A {{ class }} Module.""" | ||
|
||
from masonite.request import Request | ||
from masonite.view import View | ||
|
||
class {{ class }}: | ||
"""{{ class }} | ||
""" | ||
"""{{ class }} Controller Class.""" | ||
|
||
def __init__(self, request: Request): | ||
"""{{ class }} Initializer | ||
|
||
Arguments: | ||
request {masonite.request.Request} -- The Masonite Request class. | ||
""" | ||
self.request = request | ||
|
||
def show(self): | ||
def show(self, view: View): | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
@if test: | ||
{{ test }} | ||
@endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.