Skip to content
This repository has been archived by the owner on Jul 3, 2024. It is now read-only.

Commit

Permalink
Abbreviate resources folder to res
Browse files Browse the repository at this point in the history
  • Loading branch information
GJFR committed Mar 18, 2024
1 parent 7dc4b15 commit 6de17c2
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
experiments/pages/**
experiments/resources/**
experiments/res/**

# Created by https://www.toptal.com/developers/gitignore/api/macos,pycharm,flask,python
# Edit at https://www.toptal.com/developers/gitignore?templates=macos,pycharm,flask,python
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ services:
- "443:443"
volumes:
- ./experiments/pages:/experiments/pages
- ./experiments/resources:/app/static/resources
- ./experiments/res:/app/static/res
10 changes: 5 additions & 5 deletions experiments/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ experiments
| | |-- ...
| |-- [project 2]
| |-- ...
|-- resources
|-- res
```

- Experiments are grouped within projects inside the `pages` folder, representing sets of related experiments.

- The `resources` folder is intended to host resources that are used by multiple experiments and/or projects (e.g., scripts, images, videos)
Every resource is hosted on supported domains.
- The `res` folder is intended to host resources that are used by multiple experiments and/or projects (e.g., scripts, images, videos)
Every resource is hosted on all supported domains.


## Experiments
Expand Down Expand Up @@ -122,10 +122,10 @@ Detecting unvisited sanity check URLs can help identify failed experiments and p

## Resources

The `resources` folder is intended to host resources shared between projects (e.g., images, videos, scripts).
The `res` folder is intended to host resources shared between projects (e.g., images, videos, scripts).
All resources are hosted on each supported domain.

The example resource `experiments/resources/example.html` is hosted at the endpoints `https://[domain]/resources/example.html`, where `[domain]` can be any supported domain.
The example resource `experiments/res/example.html` is hosted at the endpoints `https://[domain]/res/example.html`, where `[domain]` can be any supported domain.


## Additional help
Expand Down
4 changes: 2 additions & 2 deletions flask/experiments.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,9 @@ def report_leak_if_contains(expected_header_name: str, expected_header_value: st
return "Redirect", 307, {"Location": "https://adition.com/report/", "Allow-CSP-From": "*"}


@exp_bp.route("/resources/<path:path>")
@exp_bp.route("/res/<path:path>")
def resources(path):
file_path = os.path.join("/app/static/resources/", path)
file_path = os.path.join("/app/static/res/", path)
if not os.path.isfile(file_path):
return "Resource not found", 404
if path.endswith(".swf"):
Expand Down

0 comments on commit 6de17c2

Please sign in to comment.