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

Extra Request details (QueryString / Body) #979

Closed
steveway1982 opened this issue Jul 21, 2017 · 2 comments
Closed

Extra Request details (QueryString / Body) #979

steveway1982 opened this issue Jul 21, 2017 · 2 comments

Comments

@steveway1982
Copy link

steveway1982 commented Jul 21, 2017

  • Browser and version:

ie: Chrome 51, IE11

  • Version of Leaflet (L.version):

1.0.0?

  • Version of esri Leaflet (L.esri.VERSION):

2.0.8, master?

Steps to reproduce the error:

I currently have my ArcGIS Server in a secured environment behind a firewall, and behind an API Gateway.

My API Gateway requires that I pass a token (myToken) to access resources. The layer allows me to set an ESRI token - that is not the issue here

The ESRI-Leaflet does not allow to add the API Gateway (myToken) token to the query string or body, or to set any kind of layer properties to add to the query string or body.

Normal convention would be to set in query string of URL parameter, therefore if i have the following URL property of the layer:

https://abc.apigateway.com/server/rest/services/mapservice?mytoken=abc

The request fails, as the request being sent is:

https://abc.apigateway.com/server/rest/services/mapservice?mytoken=abc/export?

The ESRI leaflet plugin should either:

  1. Resolved URLs, so that if a querystring parameter has been set, they are merged,
    or (preferably)
  2. have requestParam Object to the layer objects (feature, dynamic, tile etc) where the user can set such custom parameters, and the layer will either add as a querystring parameter (GET) or as body (POST).

I'm loading/bundling the library using:
webpack

@jgravois
Copy link
Contributor

you're right. dynamicMapLayer._buildExportParams() currently doesn't expose an opportunity to pass through custom request parameters.

for the time being, you can obviously insert your own logic there, but a pull request for something more generic would also be really cool.

@jgravois
Copy link
Contributor

jgravois commented Jan 5, 2018

resolved via #1036 and published in v2.1.2 thanks to @Biboba 🎉

let us know how you get on!

@jgravois jgravois closed this as completed Jan 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants