Skip to content

Conversation

@blakestoddard
Copy link
Contributor

@blakestoddard blakestoddard commented Oct 16, 2020

Image content returned from the initial request will have its Content-Type verified at https://github.com/willnorris/imageproxy/blob/main/imageproxy.go#L243. Prefilling the Accept header with the list of accepted Content-Type's has proven troublesome for some of our customers as some web servers have odd behaviors like:

  • returning an error if you provide a list of Content-Types in Accept
  • returning an error if you provide a Content-Type in Accept that the server does not know about (like image, which is not valid normally, but some web servers return content using that Content-Type 🙃)

The addition of Accept-Language is similar -- we've found some servers that will return an error if no Accept-Language header is supplied. Wack a mole!

Some customer-proxied files have been hosted on servers that will kick back errors if we a) provide a list of Accept'ed Content-Types, or b) provide a Content-Type in the Accept list that the server does not know about.
Some financial institutions will return an error via text/html if a request is made without an Accept-Language header.
@codecov
Copy link

codecov bot commented Oct 16, 2020

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.27%. Comparing base (c08b3c5) to head (6ed3117).
⚠️ Report is 124 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #252   +/-   ##
=======================================
  Coverage   87.27%   87.27%           
=======================================
  Files           6        6           
  Lines         503      503           
=======================================
  Hits          439      439           
  Misses         36       36           
  Partials       28       28           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@blakestoddard
Copy link
Contributor Author

Whoops, forgot that there was a PR for this branch. I'll pull that last commit into a different branch -- we're just disabling SVG all together since we can't properly sanitize it and security researchers keep using it to submit reports.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant