Skip to content

Commit

Permalink
Case-Sensitivity issue on MOVE/COPY actions through Windows DAV
Browse files Browse the repository at this point in the history
Update #260

Co-Authored-By: Ashton French <afrench@webworks.com>
  • Loading branch information
mar10 and afrench-webworks committed Jul 13, 2022
1 parent 7345850 commit 8ec0f8d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
## 4.0.2 / Unreleased

- #251 Fix removing locks in recursive mode
- #255 Fix ERROR: Invalid requirement: 'cheroot~=8'
- #260 Fix Case-Sensitivity issue on MOVE/COPY actions through Windows DAV

## 4.0.1 / 2022-01-11

Expand Down
5 changes: 4 additions & 1 deletion wsgidav/request_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -956,6 +956,9 @@ def _debug_exception(e):
url_scheme = environ["wsgi.url_scheme"].lower()
fwd_scheme = environ.get("HTTP_X_FORWARDED_PROTO", "").lower()

# hostnames are case-insensitive (#260)
dest_netloc = dest_netloc.lower() if dest_netloc else ""

url_host = environ["HTTP_HOST"].lower()
fwd_host = environ.get("HTTP_X_FORWARDED_HOST", "").lower()

Expand All @@ -964,7 +967,7 @@ def _debug_exception(e):
HTTP_BAD_GATEWAY,
"Source and destination must have the same scheme.\n"
"If you are running behind a reverse proxy, you may have to "
"rewrite the 'Destination' haeader.\n"
"rewrite the 'Destination' header.\n"
"(See https://github.com/mar10/wsgidav/issues/183)",
)
elif dest_netloc and dest_netloc not in (url_host, fwd_host):
Expand Down

0 comments on commit 8ec0f8d

Please sign in to comment.