8000 [Worker support] test for no cors headers by madhur-tandon · Pull Request #1374 · pyscript/pyscript · GitHub
[go: up one dir, main page]

Skip to content

[Worker support] test for no cors headers #1374

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

Merged
merged 14 commits into from
May 2, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Apr 10, 2023
commit b6450185a8daaa4f194db60afc716d2026c5293f
2 changes: 2 additions & 0 deletions pyscriptjs/tests/integration/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ class HTTPServer(SuperHTTPServer):
Ctrl +Only Thread remains dead when terminated with C.
Keyboard Interrupt passes.
"""

def __init__(self, host_and_port, handler_class):
self.handler_class = handler_class
super().__init__(host_and_port, handler_class)
Expand All @@ -149,6 +150,7 @@ def run(self):
def dev_server(logger):
class MyHTTPRequestHandler(SimpleHTTPRequestHandler):
use_cors = True

def end_headers(self):
self.send_my_headers()
SimpleHTTPRequestHandler.end_headers(self)
Expand Down
5 changes: 4 additions & 1 deletion pyscriptjs/tests/integration/support.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ def init(self, request, tmpdir, logger, page):
if request.config.option.no_fake_server:
# use a real HTTP server. Note that as soon as we request the
# fixture, the server automatically starts in its own thread.
self.dev_server, self.http_server_addr = request.getfixturevalue("dev_server")
self.dev_server, self.http_server_addr = request.getfixturevalue(
"dev_server"
)
self.router = None
else:
# use the internal playwright routing
Expand Down Expand Up @@ -655,6 +657,7 @@ class SmartRouter:
- it intercepts the requests to the network and cache the results
locally
"""

use_cors = True

@dataclass
Expand Down
0