Skip to content

JSONP renderer not compatible with AngularJS (400 Invalid JSONP callback function name) #1644

Closed
@katzlbt

Description

@katzlbt

The pyramid web framework (V1.5.6) disallows angular callbacks since newer versions, throwing the error '400 Invalid JSONP callback function name.' when used with AngularJS (V1.2.28), which passes the callback like this: ptth://example/?callback=angular.callbacks._0

What would be a workaround?
There seem to be no good options to fix this on either the AngularJS or the Pyramid side.

https://pyramid.readthedocs.org/en/master/_modules/pyramid/renderers.html
JSONP_VALID_CALLBACK = re.compile(r"^[a-zA-Z_$][0-9a-zA-Z_$]+$")

from pyramid.renderers import JSONP
config.add_renderer('jsonp',JSONP(param_name='callback'))

angular/angular.js#3073
http://stackoverflow.com/questions/29818947/pyramid-framework-disallows-jsonp-callback-format-of-angularjs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions