Skip to content

Forward http headers from clients to server #20

Closed

Description

@danikula
No description provided.

Activity

  1. self-assigned this
    on Oct 5, 2015
  2. lucas34 commented on Sep 23, 2016

    @lucas34
    Contributor

    Hi,

    In order to use your library I need this feature.
    Let me throw idea on this post.

    Structure like follow
    Topic

    • Prop 1
    • Prop 2

    Goal : Passing simple parameters in the header for the request to the server.

    Header structure.

    • Create our own Header class (Maybe be redondant with other libs)
    • Use a simple "Map<String, String>".

    How to inject

    • Inside the builder (cannot modify base on url but easier to implement)
    • Having a callback before each request with the url and return an array of headers.

    I prefer the second one because it gives more flexibility.
    We can add on the builder something like

    java builder.addHeadersInjector(new HeaderInjector() { @Override Map<String, String> inject(String url) { return createMyHeaderForThisUrl(url); } })

    When to call

    • Only call when the request is done against the real (online) server.
    • All the time

    Headers conflict

    • The library should override the headers injected by the client.

    Feel free to comment or throw more ideas.
    Lucas.

  3. danikula commented on Oct 11, 2016

    @danikula
    OwnerAuthor

    @lucas34 this is a great plan! It should really be implemented this way. Can you make PR?

  4. danikula commented on Oct 11, 2016

    @danikula
    OwnerAuthor

    Also we must write tests to check

    • are headers really added to http request?
    • does library override custom headers?
    • null HeaderInjector isn't accepted in builder

    Also we should use empty implementation of HeaderInjector to avoid null checks.

  5. danikula commented on Apr 26, 2017

    @danikula
    OwnerAuthor

    lucas34 implementation is a good start point.

  6. added a commit that references this issue on Apr 26, 2017
  7. added this to the 2.8.0 milestone on May 18, 2017
  8. added a commit that references this issue on May 18, 2017
  9. danikula commented on May 18, 2017

    @danikula
    OwnerAuthor

    I merged @lucas34 implementation to the master. Will be available in 2.8.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions