Skip to content

Change how HMAC bulk_copy params are sent to Metis #178

Description

@coleshaw

Currently, we do something like

    client.send(
      'body_request',
      Net::HTTP::Post,
      hmac.url_params[:path] + '?' + hmac.url_params[:query],
      bulk_copy_params)

But we should consider changing that to:

    hmac_params_hash = Hash[cgi_string.map {|key,values| [key.to_sym, values[0]||true]}]
    client.send(
        'body_request',
        Net::HTTP::Post,
        hmac.url_params[:path],
        params.merge(hmac_params_hash))

because with a lot of revisions, we get a Metis-side error:

 "-//IETF//DTD HTML 2.0//EN"> (Etna::Error)
<html><head>
<title>414 Request-URI Too Long</title>
</head><body>
<h1>Request-URI Too Long</h1>
<p>The requested URL's length exceeds the capacity
limit for this server.<br />
</p>
</body></html>

This is because the Etna::Hmac library puts a copy of all the extra headers passed in into hmac.url_params[:query] into new values, like X-Etna-Revisions ... which gets long.

Activity

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

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