Skip to content
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

oauthlib: url decoding problem #805

Closed
lnielsen opened this issue Sep 18, 2016 · 4 comments
Closed

oauthlib: url decoding problem #805

lnielsen opened this issue Sep 18, 2016 · 4 comments
Labels

Comments

@lnielsen
Copy link
Member

ValueError
Error trying to decode a non urlencoded string. Found invalid characters: set([u"'"]) in the string: 'f=author&ln=en&p=Christophe+Prud'homme&page=1&size=20'. Please ensure the request/response body is x-www-form-urlencoded.


Stacktrace (most recent call last):

  File "flask/app.py", line 1988, in wsgi_app
    response = self.full_dispatch_request()
  File "flask/app.py", line 1641, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "flask_cors/extension.py", line 188, in wrapped_function
    return cors_after_request(app.make_response(f(*args, **kwargs)))
  File "flask/app.py", line 1544, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "flask/app.py", line 1637, in full_dispatch_request
    rv = self.preprocess_request()
  File "flask/app.py", line 1837, in preprocess_request
    rv = func()
  File "invenio_oauth2server/ext.py", line 144, in verify_oauth_token_and_set_current_user
    valid, req = oauth2.verify_request(scopes)
  File "flask_oauthlib/provider/oauth2.py", line 483, in verify_request
    uri, http_method, body, headers, scopes
  File "oauthlib/oauth2/rfc6749/endpoints/base.py", line 64, in wrapper
    return f(endpoint, uri, *args, **kwargs)
  File "oauthlib/oauth2/rfc6749/endpoints/resource.py", line 68, in verify_request
    request = Request(uri, http_method, body, headers)
  File "oauthlib/common.py", line 405, in __init__
    self._params.update(dict(urldecode(self.uri_query)))
  File "oauthlib/common.py", line 131, in urldecode
    raise ValueError(error % (set(query) - urlencoded, query))
URL:    https://zenodo.org/api/records/
Method: GET
Query:  f=author&ln=en&p=Christophe+Prud'homme&page=1&size=20
@lnielsen lnielsen added this to the Post-Launch milestone Sep 18, 2016
@lnielsen
Copy link
Member Author

slint added a commit to slint/zenodo that referenced this issue Nov 2, 2016
* Configures Elasticsearch REST error handling by adding an extra error
  type code. (closes zenodo#791)

* Configures invenio-oauth2server to include additional allowed
  characters, fixing urlencode issues on various REST API search
  URLs. (closes zenodo#805)

Signed-off-by: Alexander Ioannidis <a.ioannidis@cern.ch>
slint added a commit to slint/zenodo that referenced this issue Nov 2, 2016
* Configures Elasticsearch REST error handling by adding an extra error
  type code. (closes zenodo#791)

* Configures invenio-oauth2server to include additional allowed
  characters, fixing urlencode issues on various REST API search
  URLs. (closes zenodo#805)

Signed-off-by: Alexander Ioannidis <a.ioannidis@cern.ch>
slint added a commit to slint/zenodo that referenced this issue Nov 18, 2016
* Configures Elasticsearch REST error handling by adding an extra error
  type code. (closes zenodo#791)

* Configures invenio-oauth2server to include additional allowed
  characters, fixing urlencode issues on various REST API search
  URLs. (closes zenodo#805)

Signed-off-by: Alexander Ioannidis <a.ioannidis@cern.ch>
slint added a commit to slint/zenodo that referenced this issue Nov 21, 2016
* Configures Elasticsearch REST error handling by adding an extra error
  type code. (closes zenodo#791)

* Configures invenio-oauth2server to include additional allowed
  characters, fixing urlencode issues on various REST API search
  URLs. (closes zenodo#805)

Signed-off-by: Alexander Ioannidis <a.ioannidis@cern.ch>
slint added a commit to slint/zenodo that referenced this issue Nov 21, 2016
* Configures Elasticsearch REST error handling by adding an extra error
  type code. (closes zenodo#791)

* Configures invenio-oauth2server to include additional allowed
  characters, fixing urlencode issues on various REST API search
  URLs. (closes zenodo#805)

Signed-off-by: Alexander Ioannidis <a.ioannidis@cern.ch>
slint added a commit to slint/zenodo that referenced this issue Nov 22, 2016
* Configures Elasticsearch REST error handling by adding an extra error
  type code. (closes zenodo#791)

* Configures invenio-oauth2server to include additional allowed
  characters, fixing urlencode issues on various REST API search
  URLs. (closes zenodo#805)

Signed-off-by: Alexander Ioannidis <a.ioannidis@cern.ch>
slint added a commit to slint/zenodo that referenced this issue Nov 22, 2016
* Configures Elasticsearch REST error handling by adding an extra error
  type code. (closes zenodo#791)

* Configures invenio-oauth2server to include additional allowed
  characters, fixing urlencode issues on various REST API search
  URLs. (closes zenodo#805)

* Swaps `invenio_records_rest.view.file_download_ui` with
  `invenio_records_files.utils.file_download_ui`.

Signed-off-by: Alexander Ioannidis <a.ioannidis@cern.ch>
slint added a commit to slint/zenodo that referenced this issue Nov 22, 2016
* Configures Elasticsearch REST error handling by adding an extra error
  type code. (closes zenodo#791)

* Configures invenio-oauth2server to include additional allowed
  characters, fixing urlencode issues on various REST API search
  URLs. (closes zenodo#805)

* Swaps `invenio_records_rest.view.file_download_ui` with
  `invenio_records_files.utils.file_download_ui`.

Signed-off-by: Alexander Ioannidis <a.ioannidis@cern.ch>
slint added a commit to slint/zenodo that referenced this issue Nov 22, 2016
* Configures Elasticsearch REST error handling by adding an extra error
  type code. (closes zenodo#791)

* Configures invenio-oauth2server to include additional allowed
  characters, fixing urlencode issues on various REST API search
  URLs. (closes zenodo#805)

* Swaps `invenio_records_rest.view.file_download_ui` with
  `invenio_records_files.utils.file_download_ui`.

Signed-off-by: Alexander Ioannidis <a.ioannidis@cern.ch>
@lnielsen lnielsen reopened this Jul 27, 2017
@lnielsen
Copy link
Member Author

This issue has re-appeared:
https://sentry.cern.ch/zenodo-admin/production/group/605479/

@lnielsen
Copy link
Member Author

curl 'https://www.zenodo.org/api/records/?q=related.identifier:%2Fhttps:\%2F\%2Fgithub.com.*%2F&page=1&size=100&sort=mostrecent'

@lnielsen
Copy link
Member Author

Related to duecredit/duecredit#117

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant