Comments (2)
After a long effort with workers, I found some browser bugs with JSONP and HTTP Basic Authentication that are impossible to work around:
- When you enter a wrong username/password in Google Chrome, authentication will fail--and then Google will provide the correct username/password you entered in a previous browser session. This is clearly a bug: if you browse to the page itself, Chrome prompts for credentials. https://code.google.com/p/chromium/issues/detail?id=147627&thanks=147627&ts=1347302705 -- the outcome is that the user sees projects and can import them, but the wrong password is set so the resulting DocumentSet has 0 documents.
- When you enter the correct username/password in Firefox, a prompt pops up over the main page asking you to save the username/password. This is confusing. I think it's prompting the user to remember the "username" and "password" fields for documentcloud.org, which is wrong. It may be prompting the user to remember the "documentcloud_email" and "documentcloud_password" fields for overviewproject.org, which would be okay.
Anyway, there is no workaround for Chrome: it will give false positives no matter how we create our requests.
The solution: XmlHttpRequest. We can set the "Authorization" header ourselves; if that fails, DocumentCloud returns a 403 error (not a 401), so Chrome won't even be tempted to exhibit its bug.
The problem with that solution is that DocumentCloud needs to be configured to accept XHR requests. That means it needs to respond to HTTP "OPTIONS" requests for certain API endpoints. I submitted a pull request: documentcloud/documentcloud#32
Believe it or not, this is less code than we'd otherwise need.
from overview-server.
This works.
from overview-server.
Related Issues (20)
- Folders tab adds space after title: in the search query, making the search fail HOT 1
- PDF viewer not highlighting search term until "next" or "highlight all" buttons clicked
- integration-test a sample plugin HOT 1
- overview-web: Log useful errors and return 500 when S3 reads fail HOT 6
- Import errors don't appear on documentset/show page
- 'Done adding files' button remains always greyed out in Safari HOT 1
- "The tag X has been applied to no documents" when deleting tags
- Quick jobs should pre-empt slow jobs
- Cancellation takes a long time to finish HOT 1
- Race: empty FileGroups can't be resumed
- Fail to index big PDF
- Fail to index a big file HOT 4
- "Show Sidebar" toggle broken for DocumentCloud iframe
- Sort: 'There is no “” field'
- search: "NOT" queries result in empty lists
- User can load overviewdocs.com/documentsets but cannot load overviewdocs.com in incognito HOT 1
- worker crash on invalid docset
- Export Notes
- Kubernetes/EKS Script Issues in 03-init-cluster.sh
- EKS issues in files apply and 04-allow-cluster-to-access-rds.sh
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from overview-server.