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 JSONP support for monitoring routes #103

Merged
merged 12 commits into from
Aug 22, 2015
Merged

Add JSONP support for monitoring routes #103

merged 12 commits into from
Aug 22, 2015

Conversation

devfacet
Copy link
Contributor

See #100

@pkieltyka
Copy link

Also, the response content-type for jsonp is application/javascript

@devfacet
Copy link
Contributor Author

Damn finally...

// ResponseHandler handles responses for monitoring routes
func ResponseHandler(w http.ResponseWriter, r *http.Request, data []byte) {
// Get callback from request
callback := r.FormValue("callback")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably better off just using r.URL.Query().Get("callback") as you only need to check the URL query params

@devfacet
Copy link
Contributor Author

@pkieltyka : done, thank you 😄

@derekcollison
Copy link
Member

If not done already could someone update README to reflect the JSONP functionality?

@devfacet
Copy link
Contributor Author

@derekcollison : What kind of information you want to see in README related to this PR?

P.S.: Personally I'm thinking that README.md should be very lightweight for first impression. JSONP is a low level detail which should be in another file. Perhaps in a dedicated monitoring documentation or a file named API.md in root folder which contains everything about gnatsd with all the details.

@derekcollison
Copy link
Member

The README has a monitoring section, just add a one liner that says it
supports JSONP via the callback arg and a simple example. No need for each
endpoint, just one IMO..

On Tue, Aug 18, 2015 at 5:29 PM, Fatih Cetinkaya notifications@github.com
wrote:

@derekcollison https://github.com/derekcollison : What kind of
information you want to see in README related to this PR?

P.S.: Personally I'm thinking that README.md should be very lightweight
for first impression. JSONP is a low level detail which should be in
another file. Perhaps in a dedicated monitoring documentation or a file
named API.md in root folder which contains everything about gnatsd with
all the details.


Reply to this email directly or view it on GitHub
#103 (comment).

@derekcollison
Copy link
Member

This good to go?

@devfacet
Copy link
Contributor Author

I just added a note to README about JSONP. I think it is okay to go...

derekcollison added a commit that referenced this pull request Aug 22, 2015
Add JSONP support for monitoring routes
@derekcollison derekcollison merged commit 19fa089 into nats-io:master Aug 22, 2015
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

Successfully merging this pull request may close these issues.

None yet

3 participants