Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

turbolinks-location

Package Overview
Dependencies
Maintainers
2
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

turbolinks-location

Adds `Turbolinks-Location` header to responses so Turbolinks can update the browser URL correctly. See <https://github.com/turbolinks/turbolinks#following-redirects>.

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
increased by100%
Maintainers
2
Weekly downloads
 
Created
Source

Adds Turbolinks-Location header to responses so Turbolinks can update the browser URL correctly. See https://github.com/turbolinks/turbolinks#following-redirects.

Installation

$ npm install --save turbolinks-location

API

var turbolinksLocation = require('turbolinks-location')

app.use(turbolinksLocation(options))

Options

onlyWhenHeader

When true, only send Turbolinks-Location header when the incoming request has a header indicating it is a Turbolinks request. Default: false (meaning Turbolinks-Location is sent on every response).

Here's how to set such a header:

document.addEventListener("turbolinks:request-start", function(event) {
  var xhr = event.data.xhr
  xhr.setRequestHeader("x-turbolinks-request", "true")
})

See also https://github.com/turbolinks/turbolinks#setting-custom-http-headers.

header

The name of the request header to look for. Default: x-turbolinks-request.

Keywords

FAQs

Package last updated on 19 Sep 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc