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

add option to allow resource without trailing slash? #61

Closed
Chris2048 opened this issue Jun 9, 2013 · 4 comments
Closed

add option to allow resource without trailing slash? #61

Chris2048 opened this issue Jun 9, 2013 · 4 comments

Comments

@Chris2048
Copy link

I'm trying to use flask-eve with angular resources. The problems is, angular seems to remove the trailing slash from the url.

When eve gets this url, it gives a 301 response, but I don't think angular will follow this :-|

Is it possible to configure eve to serve from a slashless resource without a redirect?

Thanks.

@nicolaiarocci
Copy link
Member

Hello,

it looks like an angular issue, however if you look at this SO thread you will find that

  • There's an open ticket already
  • You probably can get around it by just escaping the trailing slash (see Vincent comment to accepted answer).

Hope this helps!

@Chris2048
Copy link
Author

Yes, thanks, it seems using "host/:param" will prevent the slash being removed.

@shea256
Copy link
Contributor

shea256 commented Aug 5, 2013

So with a regular flask app, you can do the following to allow requests without trailing slashes:

app.url_map.strict_slashes = False

However, I tried this with eve and it doesn't seem to work.

@shea256
Copy link
Contributor

shea256 commented Sep 19, 2013

@nicolaiarocci do you think it's a good idea to give leeway with trailing slashes in requests?

If so, it would be a quick fix to allow for my app.url_map.strict_slashes = False suggestion.

EDIT: apologies, it looks like this was updated

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

No branches or pull requests

3 participants